/* * 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 DiscoverInstancesRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

*/ private String namespaceName; /** *

* The name of the service that you specified when you registered the instance. *

*/ private String serviceName; /** *

* The maximum number of instances that you want Cloud Map to return in the response to a * DiscoverInstances request. If you don't specify a value for MaxResults, Cloud Map * returns up to 100 instances. *

*/ private Integer maxResults; /** *

* Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are returned. *

*/ private java.util.Map queryParameters; /** *

* Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the * filters specified in both the QueryParameters parameter and this parameter, all of these instances * are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in * the QueryParameters parameter are returned. *

*/ private java.util.Map optionalParameters; /** *

* The health status of the instances that you want to discover. This parameter is ignored for services that don't * have a health check configured, and all instances are returned. *

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is * also called failing open. *

*
*
*/ private String healthStatus; /** *

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

* * @param namespaceName * The HttpName name of the namespace. It's found in the HttpProperties member of * the Properties member of the namespace. */ public void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } /** *

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

* * @return The HttpName name of the namespace. It's found in the HttpProperties member of * the Properties member of the namespace. */ public String getNamespaceName() { return this.namespaceName; } /** *

* The HttpName name of the namespace. It's found in the HttpProperties member of the * Properties member of the namespace. *

* * @param namespaceName * The HttpName name of the namespace. It's found in the HttpProperties member of * the Properties member of the namespace. * @return Returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest withNamespaceName(String namespaceName) { setNamespaceName(namespaceName); return this; } /** *

* The name of the service that you specified when you registered the instance. *

* * @param serviceName * The name of the service that you specified when you registered the instance. */ public void setServiceName(String serviceName) { this.serviceName = serviceName; } /** *

* The name of the service that you specified when you registered the instance. *

* * @return The name of the service that you specified when you registered the instance. */ public String getServiceName() { return this.serviceName; } /** *

* The name of the service that you specified when you registered the instance. *

* * @param serviceName * The name of the service that you specified when you registered the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest withServiceName(String serviceName) { setServiceName(serviceName); return this; } /** *

* The maximum number of instances that you want Cloud Map to return in the response to a * DiscoverInstances request. If you don't specify a value for MaxResults, Cloud Map * returns up to 100 instances. *

* * @param maxResults * The maximum number of instances that you want Cloud Map to return in the response to a * DiscoverInstances 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 * DiscoverInstances request. If you don't specify a value for MaxResults, Cloud Map * returns up to 100 instances. *

* * @return The maximum number of instances that you want Cloud Map to return in the response to a * DiscoverInstances 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 * DiscoverInstances request. If you don't specify a value for MaxResults, Cloud Map * returns up to 100 instances. *

* * @param maxResults * The maximum number of instances that you want Cloud Map to return in the response to a * DiscoverInstances 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 DiscoverInstancesRequest withMaxResults(Integer maxResults) { setMaxResults(maxResults); return this; } /** *

* Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are returned. *

* * @return Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are * returned. */ public java.util.Map getQueryParameters() { return queryParameters; } /** *

* Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are returned. *

* * @param queryParameters * Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are * returned. */ public void setQueryParameters(java.util.Map queryParameters) { this.queryParameters = queryParameters; } /** *

* Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are returned. *

* * @param queryParameters * Filters to scope the results based on custom attributes for the instance (for example, * {version=v1, az=1a}). Only instances that match all the specified key-value pairs are * returned. * @return Returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest withQueryParameters(java.util.Map queryParameters) { setQueryParameters(queryParameters); return this; } /** * Add a single QueryParameters entry * * @see DiscoverInstancesRequest#withQueryParameters * @returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest addQueryParametersEntry(String key, String value) { if (null == this.queryParameters) { this.queryParameters = new java.util.HashMap(); } if (this.queryParameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.queryParameters.put(key, value); return this; } /** * Removes all the entries added into QueryParameters. * * @return Returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest clearQueryParametersEntries() { this.queryParameters = null; return this; } /** *

* Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the * filters specified in both the QueryParameters parameter and this parameter, all of these instances * are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in * the QueryParameters parameter are returned. *

* * @return Opportunistic filters to scope the results based on custom attributes. If there are instances that match * both the filters specified in both the QueryParameters parameter and this parameter, all of * these instances are returned. Otherwise, the filters are ignored, and only instances that match the * filters that are specified in the QueryParameters parameter are returned. */ public java.util.Map getOptionalParameters() { return optionalParameters; } /** *

* Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the * filters specified in both the QueryParameters parameter and this parameter, all of these instances * are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in * the QueryParameters parameter are returned. *

* * @param optionalParameters * Opportunistic filters to scope the results based on custom attributes. If there are instances that match * both the filters specified in both the QueryParameters parameter and this parameter, all of * these instances are returned. Otherwise, the filters are ignored, and only instances that match the * filters that are specified in the QueryParameters parameter are returned. */ public void setOptionalParameters(java.util.Map optionalParameters) { this.optionalParameters = optionalParameters; } /** *

* Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the * filters specified in both the QueryParameters parameter and this parameter, all of these instances * are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in * the QueryParameters parameter are returned. *

* * @param optionalParameters * Opportunistic filters to scope the results based on custom attributes. If there are instances that match * both the filters specified in both the QueryParameters parameter and this parameter, all of * these instances are returned. Otherwise, the filters are ignored, and only instances that match the * filters that are specified in the QueryParameters parameter are returned. * @return Returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest withOptionalParameters(java.util.Map optionalParameters) { setOptionalParameters(optionalParameters); return this; } /** * Add a single OptionalParameters entry * * @see DiscoverInstancesRequest#withOptionalParameters * @returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest addOptionalParametersEntry(String key, String value) { if (null == this.optionalParameters) { this.optionalParameters = new java.util.HashMap(); } if (this.optionalParameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.optionalParameters.put(key, value); return this; } /** * Removes all the entries added into OptionalParameters. * * @return Returns a reference to this object so that method calls can be chained together. */ public DiscoverInstancesRequest clearOptionalParametersEntries() { this.optionalParameters = null; return this; } /** *

* The health status of the instances that you want to discover. This parameter is ignored for services that don't * have a health check configured, and all instances are returned. *

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is * also called failing open. *

*
*
* * @param healthStatus * The health status of the instances that you want to discover. This parameter is ignored for services that * don't have a health check configured, and all instances are returned.

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. * This is also called failing open. *

*
* @see HealthStatusFilter */ public void setHealthStatus(String healthStatus) { this.healthStatus = healthStatus; } /** *

* The health status of the instances that you want to discover. This parameter is ignored for services that don't * have a health check configured, and all instances are returned. *

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is * also called failing open. *

*
*
* * @return The health status of the instances that you want to discover. This parameter is ignored for services that * don't have a health check configured, and all instances are returned.

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. * This is also called failing open. *

*
* @see HealthStatusFilter */ public String getHealthStatus() { return this.healthStatus; } /** *

* The health status of the instances that you want to discover. This parameter is ignored for services that don't * have a health check configured, and all instances are returned. *

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is * also called failing open. *

*
*
* * @param healthStatus * The health status of the instances that you want to discover. This parameter is ignored for services that * don't have a health check configured, and all instances are returned.

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. * This is also called failing open. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see HealthStatusFilter */ public DiscoverInstancesRequest withHealthStatus(String healthStatus) { setHealthStatus(healthStatus); return this; } /** *

* The health status of the instances that you want to discover. This parameter is ignored for services that don't * have a health check configured, and all instances are returned. *

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is * also called failing open. *

*
*
* * @param healthStatus * The health status of the instances that you want to discover. This parameter is ignored for services that * don't have a health check configured, and all instances are returned.

*
*
HEALTHY
*
*

* Returns healthy instances. *

*
*
UNHEALTHY
*
*

* Returns unhealthy instances. *

*
*
ALL
*
*

* Returns all instances. *

*
*
HEALTHY_OR_ELSE_ALL
*
*

* Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. * This is also called failing open. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see HealthStatusFilter */ public DiscoverInstancesRequest withHealthStatus(HealthStatusFilter healthStatus) { this.healthStatus = healthStatus.toString(); 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 (getNamespaceName() != null) sb.append("NamespaceName: ").append(getNamespaceName()).append(","); if (getServiceName() != null) sb.append("ServiceName: ").append(getServiceName()).append(","); if (getMaxResults() != null) sb.append("MaxResults: ").append(getMaxResults()).append(","); if (getQueryParameters() != null) sb.append("QueryParameters: ").append(getQueryParameters()).append(","); if (getOptionalParameters() != null) sb.append("OptionalParameters: ").append(getOptionalParameters()).append(","); if (getHealthStatus() != null) sb.append("HealthStatus: ").append(getHealthStatus()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DiscoverInstancesRequest == false) return false; DiscoverInstancesRequest other = (DiscoverInstancesRequest) obj; if (other.getNamespaceName() == null ^ this.getNamespaceName() == null) return false; if (other.getNamespaceName() != null && other.getNamespaceName().equals(this.getNamespaceName()) == false) return false; if (other.getServiceName() == null ^ this.getServiceName() == null) return false; if (other.getServiceName() != null && other.getServiceName().equals(this.getServiceName()) == 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.getQueryParameters() == null ^ this.getQueryParameters() == null) return false; if (other.getQueryParameters() != null && other.getQueryParameters().equals(this.getQueryParameters()) == false) return false; if (other.getOptionalParameters() == null ^ this.getOptionalParameters() == null) return false; if (other.getOptionalParameters() != null && other.getOptionalParameters().equals(this.getOptionalParameters()) == false) return false; if (other.getHealthStatus() == null ^ this.getHealthStatus() == null) return false; if (other.getHealthStatus() != null && other.getHealthStatus().equals(this.getHealthStatus()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getNamespaceName() == null) ? 0 : getNamespaceName().hashCode()); hashCode = prime * hashCode + ((getServiceName() == null) ? 0 : getServiceName().hashCode()); hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); hashCode = prime * hashCode + ((getQueryParameters() == null) ? 0 : getQueryParameters().hashCode()); hashCode = prime * hashCode + ((getOptionalParameters() == null) ? 0 : getOptionalParameters().hashCode()); hashCode = prime * hashCode + ((getHealthStatus() == null) ? 0 : getHealthStatus().hashCode()); return hashCode; } @Override public DiscoverInstancesRequest clone() { return (DiscoverInstancesRequest) super.clone(); } }