software.amazon.awssdk.services.connect.model.AgentInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connect Show documentation
Show all versions of connect Show documentation
The AWS Java SDK for Connect module holds the client classes that are used for
communicating with Connect.
/*
* Copyright 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.connect.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Information about the agent who accepted the contact.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AgentInfo implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id")
.getter(getter(AgentInfo::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();
private static final SdkField CONNECTED_TO_AGENT_TIMESTAMP_FIELD = SdkField
. builder(MarshallingType.INSTANT).memberName("ConnectedToAgentTimestamp")
.getter(getter(AgentInfo::connectedToAgentTimestamp)).setter(setter(Builder::connectedToAgentTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectedToAgentTimestamp").build())
.build();
private static final SdkField AGENT_PAUSE_DURATION_IN_SECONDS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("AgentPauseDurationInSeconds")
.getter(getter(AgentInfo::agentPauseDurationInSeconds))
.setter(setter(Builder::agentPauseDurationInSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AgentPauseDurationInSeconds")
.build()).build();
private static final SdkField HIERARCHY_GROUPS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("HierarchyGroups")
.getter(getter(AgentInfo::hierarchyGroups)).setter(setter(Builder::hierarchyGroups))
.constructor(HierarchyGroups::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HierarchyGroups").build()).build();
private static final SdkField DEVICE_INFO_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("DeviceInfo").getter(getter(AgentInfo::deviceInfo)).setter(setter(Builder::deviceInfo))
.constructor(DeviceInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceInfo").build()).build();
private static final SdkField CAPABILITIES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Capabilities")
.getter(getter(AgentInfo::capabilities)).setter(setter(Builder::capabilities))
.constructor(ParticipantCapabilities::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Capabilities").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD,
CONNECTED_TO_AGENT_TIMESTAMP_FIELD, AGENT_PAUSE_DURATION_IN_SECONDS_FIELD, HIERARCHY_GROUPS_FIELD, DEVICE_INFO_FIELD,
CAPABILITIES_FIELD));
private static final long serialVersionUID = 1L;
private final String id;
private final Instant connectedToAgentTimestamp;
private final Integer agentPauseDurationInSeconds;
private final HierarchyGroups hierarchyGroups;
private final DeviceInfo deviceInfo;
private final ParticipantCapabilities capabilities;
private AgentInfo(BuilderImpl builder) {
this.id = builder.id;
this.connectedToAgentTimestamp = builder.connectedToAgentTimestamp;
this.agentPauseDurationInSeconds = builder.agentPauseDurationInSeconds;
this.hierarchyGroups = builder.hierarchyGroups;
this.deviceInfo = builder.deviceInfo;
this.capabilities = builder.capabilities;
}
/**
*
* The identifier of the agent who accepted the contact.
*
*
* @return The identifier of the agent who accepted the contact.
*/
public final String id() {
return id;
}
/**
*
* The timestamp when the contact was connected to the agent.
*
*
* @return The timestamp when the contact was connected to the agent.
*/
public final Instant connectedToAgentTimestamp() {
return connectedToAgentTimestamp;
}
/**
*
* Agent pause duration for a contact in seconds.
*
*
* @return Agent pause duration for a contact in seconds.
*/
public final Integer agentPauseDurationInSeconds() {
return agentPauseDurationInSeconds;
}
/**
*
* The agent hierarchy groups for the agent.
*
*
* @return The agent hierarchy groups for the agent.
*/
public final HierarchyGroups hierarchyGroups() {
return hierarchyGroups;
}
/**
*
* Information regarding Agent’s device.
*
*
* @return Information regarding Agent’s device.
*/
public final DeviceInfo deviceInfo() {
return deviceInfo;
}
/**
* Returns the value of the Capabilities property for this object.
*
* @return The value of the Capabilities property for this object.
*/
public final ParticipantCapabilities capabilities() {
return capabilities;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(connectedToAgentTimestamp());
hashCode = 31 * hashCode + Objects.hashCode(agentPauseDurationInSeconds());
hashCode = 31 * hashCode + Objects.hashCode(hierarchyGroups());
hashCode = 31 * hashCode + Objects.hashCode(deviceInfo());
hashCode = 31 * hashCode + Objects.hashCode(capabilities());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AgentInfo)) {
return false;
}
AgentInfo other = (AgentInfo) obj;
return Objects.equals(id(), other.id()) && Objects.equals(connectedToAgentTimestamp(), other.connectedToAgentTimestamp())
&& Objects.equals(agentPauseDurationInSeconds(), other.agentPauseDurationInSeconds())
&& Objects.equals(hierarchyGroups(), other.hierarchyGroups()) && Objects.equals(deviceInfo(), other.deviceInfo())
&& Objects.equals(capabilities(), other.capabilities());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("AgentInfo").add("Id", id()).add("ConnectedToAgentTimestamp", connectedToAgentTimestamp())
.add("AgentPauseDurationInSeconds", agentPauseDurationInSeconds()).add("HierarchyGroups", hierarchyGroups())
.add("DeviceInfo", deviceInfo()).add("Capabilities", capabilities()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "ConnectedToAgentTimestamp":
return Optional.ofNullable(clazz.cast(connectedToAgentTimestamp()));
case "AgentPauseDurationInSeconds":
return Optional.ofNullable(clazz.cast(agentPauseDurationInSeconds()));
case "HierarchyGroups":
return Optional.ofNullable(clazz.cast(hierarchyGroups()));
case "DeviceInfo":
return Optional.ofNullable(clazz.cast(deviceInfo()));
case "Capabilities":
return Optional.ofNullable(clazz.cast(capabilities()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function