Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.connect.model.Queue Maven / Gradle / Ivy
/*
* 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.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Contains information about a queue.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Queue implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(Queue::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField QUEUE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("QueueArn").getter(getter(Queue::queueArn)).setter(setter(Builder::queueArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QueueArn").build()).build();
private static final SdkField QUEUE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("QueueId").getter(getter(Queue::queueId)).setter(setter(Builder::queueId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QueueId").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(Queue::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField OUTBOUND_CALLER_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OutboundCallerConfig")
.getter(getter(Queue::outboundCallerConfig)).setter(setter(Builder::outboundCallerConfig))
.constructor(OutboundCallerConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutboundCallerConfig").build())
.build();
private static final SdkField HOURS_OF_OPERATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("HoursOfOperationId").getter(getter(Queue::hoursOfOperationId))
.setter(setter(Builder::hoursOfOperationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HoursOfOperationId").build())
.build();
private static final SdkField MAX_CONTACTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxContacts").getter(getter(Queue::maxContacts)).setter(setter(Builder::maxContacts))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxContacts").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(Queue::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Tags")
.getter(getter(Queue::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, QUEUE_ARN_FIELD,
QUEUE_ID_FIELD, DESCRIPTION_FIELD, OUTBOUND_CALLER_CONFIG_FIELD, HOURS_OF_OPERATION_ID_FIELD, MAX_CONTACTS_FIELD,
STATUS_FIELD, TAGS_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final String queueArn;
private final String queueId;
private final String description;
private final OutboundCallerConfig outboundCallerConfig;
private final String hoursOfOperationId;
private final Integer maxContacts;
private final String status;
private final Map tags;
private Queue(BuilderImpl builder) {
this.name = builder.name;
this.queueArn = builder.queueArn;
this.queueId = builder.queueId;
this.description = builder.description;
this.outboundCallerConfig = builder.outboundCallerConfig;
this.hoursOfOperationId = builder.hoursOfOperationId;
this.maxContacts = builder.maxContacts;
this.status = builder.status;
this.tags = builder.tags;
}
/**
*
* The name of the queue.
*
*
* @return The name of the queue.
*/
public final String name() {
return name;
}
/**
*
* The Amazon Resource Name (ARN) for the queue.
*
*
* @return The Amazon Resource Name (ARN) for the queue.
*/
public final String queueArn() {
return queueArn;
}
/**
*
* The identifier for the queue.
*
*
* @return The identifier for the queue.
*/
public final String queueId() {
return queueId;
}
/**
*
* The description of the queue.
*
*
* @return The description of the queue.
*/
public final String description() {
return description;
}
/**
*
* The outbound caller ID name, number, and outbound whisper flow.
*
*
* @return The outbound caller ID name, number, and outbound whisper flow.
*/
public final OutboundCallerConfig outboundCallerConfig() {
return outboundCallerConfig;
}
/**
*
* The identifier for the hours of operation.
*
*
* @return The identifier for the hours of operation.
*/
public final String hoursOfOperationId() {
return hoursOfOperationId;
}
/**
*
* The maximum number of contacts that can be in the queue before it is considered full.
*
*
* @return The maximum number of contacts that can be in the queue before it is considered full.
*/
public final Integer maxContacts() {
return maxContacts;
}
/**
*
* The status of the queue.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link QueueStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the queue.
* @see QueueStatus
*/
public final QueueStatus status() {
return QueueStatus.fromValue(status);
}
/**
*
* The status of the queue.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link QueueStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the queue.
* @see QueueStatus
*/
public final String statusAsString() {
return status;
}
/**
* Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* One or more tags.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasTags()} to see if a value was sent in this field.
*
*
* @return One or more tags.
*/
public final Map tags() {
return tags;
}
@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(name());
hashCode = 31 * hashCode + Objects.hashCode(queueArn());
hashCode = 31 * hashCode + Objects.hashCode(queueId());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(outboundCallerConfig());
hashCode = 31 * hashCode + Objects.hashCode(hoursOfOperationId());
hashCode = 31 * hashCode + Objects.hashCode(maxContacts());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
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 Queue)) {
return false;
}
Queue other = (Queue) obj;
return Objects.equals(name(), other.name()) && Objects.equals(queueArn(), other.queueArn())
&& Objects.equals(queueId(), other.queueId()) && Objects.equals(description(), other.description())
&& Objects.equals(outboundCallerConfig(), other.outboundCallerConfig())
&& Objects.equals(hoursOfOperationId(), other.hoursOfOperationId())
&& Objects.equals(maxContacts(), other.maxContacts()) && Objects.equals(statusAsString(), other.statusAsString())
&& hasTags() == other.hasTags() && Objects.equals(tags(), other.tags());
}
/**
* 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("Queue").add("Name", name()).add("QueueArn", queueArn()).add("QueueId", queueId())
.add("Description", description()).add("OutboundCallerConfig", outboundCallerConfig())
.add("HoursOfOperationId", hoursOfOperationId()).add("MaxContacts", maxContacts())
.add("Status", statusAsString()).add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "QueueArn":
return Optional.ofNullable(clazz.cast(queueArn()));
case "QueueId":
return Optional.ofNullable(clazz.cast(queueId()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "OutboundCallerConfig":
return Optional.ofNullable(clazz.cast(outboundCallerConfig()));
case "HoursOfOperationId":
return Optional.ofNullable(clazz.cast(hoursOfOperationId()));
case "MaxContacts":
return Optional.ofNullable(clazz.cast(maxContacts()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((Queue) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The name of the queue.
*
*
* @param name
* The name of the queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* The Amazon Resource Name (ARN) for the queue.
*
*
* @param queueArn
* The Amazon Resource Name (ARN) for the queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queueArn(String queueArn);
/**
*
* The identifier for the queue.
*
*
* @param queueId
* The identifier for the queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queueId(String queueId);
/**
*
* The description of the queue.
*
*
* @param description
* The description of the queue.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* The outbound caller ID name, number, and outbound whisper flow.
*
*
* @param outboundCallerConfig
* The outbound caller ID name, number, and outbound whisper flow.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder outboundCallerConfig(OutboundCallerConfig outboundCallerConfig);
/**
*
* The outbound caller ID name, number, and outbound whisper flow.
*
* This is a convenience that creates an instance of the {@link OutboundCallerConfig.Builder} avoiding the need
* to create one manually via {@link OutboundCallerConfig#builder()}.
*
* When the {@link Consumer} completes, {@link OutboundCallerConfig.Builder#build()} is called immediately and
* its result is passed to {@link #outboundCallerConfig(OutboundCallerConfig)}.
*
* @param outboundCallerConfig
* a consumer that will call methods on {@link OutboundCallerConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #outboundCallerConfig(OutboundCallerConfig)
*/
default Builder outboundCallerConfig(Consumer outboundCallerConfig) {
return outboundCallerConfig(OutboundCallerConfig.builder().applyMutation(outboundCallerConfig).build());
}
/**
*
* The identifier for the hours of operation.
*
*
* @param hoursOfOperationId
* The identifier for the hours of operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder hoursOfOperationId(String hoursOfOperationId);
/**
*
* The maximum number of contacts that can be in the queue before it is considered full.
*
*
* @param maxContacts
* The maximum number of contacts that can be in the queue before it is considered full.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder maxContacts(Integer maxContacts);
/**
*
* The status of the queue.
*
*
* @param status
* The status of the queue.
* @see QueueStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see QueueStatus
*/
Builder status(String status);
/**
*
* The status of the queue.
*
*
* @param status
* The status of the queue.
* @see QueueStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see QueueStatus
*/
Builder status(QueueStatus status);
/**
*
* One or more tags.
*
*
* @param tags
* One or more tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl implements Builder {
private String name;
private String queueArn;
private String queueId;
private String description;
private OutboundCallerConfig outboundCallerConfig;
private String hoursOfOperationId;
private Integer maxContacts;
private String status;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(Queue model) {
name(model.name);
queueArn(model.queueArn);
queueId(model.queueId);
description(model.description);
outboundCallerConfig(model.outboundCallerConfig);
hoursOfOperationId(model.hoursOfOperationId);
maxContacts(model.maxContacts);
status(model.status);
tags(model.tags);
}
public final String getName() {
return name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final void setName(String name) {
this.name = name;
}
public final String getQueueArn() {
return queueArn;
}
@Override
public final Builder queueArn(String queueArn) {
this.queueArn = queueArn;
return this;
}
public final void setQueueArn(String queueArn) {
this.queueArn = queueArn;
}
public final String getQueueId() {
return queueId;
}
@Override
public final Builder queueId(String queueId) {
this.queueId = queueId;
return this;
}
public final void setQueueId(String queueId) {
this.queueId = queueId;
}
public final String getDescription() {
return description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final void setDescription(String description) {
this.description = description;
}
public final OutboundCallerConfig.Builder getOutboundCallerConfig() {
return outboundCallerConfig != null ? outboundCallerConfig.toBuilder() : null;
}
@Override
public final Builder outboundCallerConfig(OutboundCallerConfig outboundCallerConfig) {
this.outboundCallerConfig = outboundCallerConfig;
return this;
}
public final void setOutboundCallerConfig(OutboundCallerConfig.BuilderImpl outboundCallerConfig) {
this.outboundCallerConfig = outboundCallerConfig != null ? outboundCallerConfig.build() : null;
}
public final String getHoursOfOperationId() {
return hoursOfOperationId;
}
@Override
public final Builder hoursOfOperationId(String hoursOfOperationId) {
this.hoursOfOperationId = hoursOfOperationId;
return this;
}
public final void setHoursOfOperationId(String hoursOfOperationId) {
this.hoursOfOperationId = hoursOfOperationId;
}
public final Integer getMaxContacts() {
return maxContacts;
}
@Override
public final Builder maxContacts(Integer maxContacts) {
this.maxContacts = maxContacts;
return this;
}
public final void setMaxContacts(Integer maxContacts) {
this.maxContacts = maxContacts;
}
public final String getStatus() {
return status;
}
@Override
public final Builder status(String status) {
this.status = status;
return this;
}
@Override
public final Builder status(QueueStatus status) {
this.status(status == null ? null : status.toString());
return this;
}
public final void setStatus(String status) {
this.status = status;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
@Override
public final Builder tags(Map tags) {
this.tags = TagMapCopier.copy(tags);
return this;
}
public final void setTags(Map tags) {
this.tags = TagMapCopier.copy(tags);
}
@Override
public Queue build() {
return new Queue(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}