software.amazon.awssdk.services.applicationdiscovery.model.DescribeAgentsResponse Maven / Gradle / Ivy
Show all versions of discovery Show documentation
/*
* Copyright 2013-2018 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 software.amazon.awssdk.services.applicationdiscovery.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Generated;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class DescribeAgentsResponse extends ApplicationDiscoveryResponse implements
ToCopyableBuilder {
private final List agentsInfo;
private final String nextToken;
private DescribeAgentsResponse(BuilderImpl builder) {
super(builder);
this.agentsInfo = builder.agentsInfo;
this.nextToken = builder.nextToken;
}
/**
*
* Lists agents or the Connector by ID or lists all agents/Connectors associated with your user account if you did
* not specify an agent/Connector ID. The output includes agent/Connector IDs, IP addresses, media access control
* (MAC) addresses, agent/Connector health, host name where the agent/Connector resides, and the version number of
* each agent/Connector.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Lists agents or the Connector by ID or lists all agents/Connectors associated with your user account if
* you did not specify an agent/Connector ID. The output includes agent/Connector IDs, IP addresses, media
* access control (MAC) addresses, agent/Connector health, host name where the agent/Connector resides, and
* the version number of each agent/Connector.
*/
public List agentsInfo() {
return agentsInfo;
}
/**
*
* Token to retrieve the next set of results. For example, if you specified 100 IDs for
* DescribeAgentsRequest$agentIds
but set DescribeAgentsRequest$maxResults
to 10, you
* received a set of 10 results along with this token. Use this token in the next query to retrieve the next set of
* 10.
*
*
* @return Token to retrieve the next set of results. For example, if you specified 100 IDs for
* DescribeAgentsRequest$agentIds
but set DescribeAgentsRequest$maxResults
to 10,
* you received a set of 10 results along with this token. Use this token in the next query to retrieve the
* next set of 10.
*/
public String nextToken() {
return nextToken;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(agentsInfo());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DescribeAgentsResponse)) {
return false;
}
DescribeAgentsResponse other = (DescribeAgentsResponse) obj;
return Objects.equals(agentsInfo(), other.agentsInfo()) && Objects.equals(nextToken(), other.nextToken());
}
@Override
public String toString() {
return ToString.builder("DescribeAgentsResponse").add("AgentsInfo", agentsInfo()).add("NextToken", nextToken()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "agentsInfo":
return Optional.of(clazz.cast(agentsInfo()));
case "nextToken":
return Optional.of(clazz.cast(nextToken()));
default:
return Optional.empty();
}
}
public interface Builder extends ApplicationDiscoveryResponse.Builder, CopyableBuilder {
/**
*
* Lists agents or the Connector by ID or lists all agents/Connectors associated with your user account if you
* did not specify an agent/Connector ID. The output includes agent/Connector IDs, IP addresses, media access
* control (MAC) addresses, agent/Connector health, host name where the agent/Connector resides, and the version
* number of each agent/Connector.
*
*
* @param agentsInfo
* Lists agents or the Connector by ID or lists all agents/Connectors associated with your user account
* if you did not specify an agent/Connector ID. The output includes agent/Connector IDs, IP addresses,
* media access control (MAC) addresses, agent/Connector health, host name where the agent/Connector
* resides, and the version number of each agent/Connector.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder agentsInfo(Collection agentsInfo);
/**
*
* Lists agents or the Connector by ID or lists all agents/Connectors associated with your user account if you
* did not specify an agent/Connector ID. The output includes agent/Connector IDs, IP addresses, media access
* control (MAC) addresses, agent/Connector health, host name where the agent/Connector resides, and the version
* number of each agent/Connector.
*
*
* @param agentsInfo
* Lists agents or the Connector by ID or lists all agents/Connectors associated with your user account
* if you did not specify an agent/Connector ID. The output includes agent/Connector IDs, IP addresses,
* media access control (MAC) addresses, agent/Connector health, host name where the agent/Connector
* resides, and the version number of each agent/Connector.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder agentsInfo(AgentInfo... agentsInfo);
/**
*
* Token to retrieve the next set of results. For example, if you specified 100 IDs for
* DescribeAgentsRequest$agentIds
but set DescribeAgentsRequest$maxResults
to 10, you
* received a set of 10 results along with this token. Use this token in the next query to retrieve the next set
* of 10.
*
*
* @param nextToken
* Token to retrieve the next set of results. For example, if you specified 100 IDs for
* DescribeAgentsRequest$agentIds
but set DescribeAgentsRequest$maxResults
to
* 10, you received a set of 10 results along with this token. Use this token in the next query to
* retrieve the next set of 10.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nextToken(String nextToken);
}
static final class BuilderImpl extends ApplicationDiscoveryResponse.BuilderImpl implements Builder {
private List agentsInfo;
private String nextToken;
private BuilderImpl() {
}
private BuilderImpl(DescribeAgentsResponse model) {
agentsInfo(model.agentsInfo);
nextToken(model.nextToken);
}
public final Collection getAgentsInfo() {
return agentsInfo != null ? agentsInfo.stream().map(AgentInfo::toBuilder).collect(Collectors.toList()) : null;
}
@Override
public final Builder agentsInfo(Collection agentsInfo) {
this.agentsInfo = AgentsInfoCopier.copy(agentsInfo);
return this;
}
@Override
@SafeVarargs
public final Builder agentsInfo(AgentInfo... agentsInfo) {
agentsInfo(Arrays.asList(agentsInfo));
return this;
}
public final void setAgentsInfo(Collection agentsInfo) {
this.agentsInfo = AgentsInfoCopier.copyFromBuilder(agentsInfo);
}
public final String getNextToken() {
return nextToken;
}
@Override
public final Builder nextToken(String nextToken) {
this.nextToken = nextToken;
return this;
}
public final void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
@Override
public DescribeAgentsResponse build() {
return new DescribeAgentsResponse(this);
}
}
}