software.amazon.awssdk.services.connect.model.SendChatIntegrationEventRequest Maven / Gradle / Ivy
Show all versions of connect Show documentation
/*
* 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.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.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class SendChatIntegrationEventRequest extends ConnectRequest implements
ToCopyableBuilder {
private static final SdkField SOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceId").getter(getter(SendChatIntegrationEventRequest::sourceId)).setter(setter(Builder::sourceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceId").build()).build();
private static final SdkField DESTINATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DestinationId").getter(getter(SendChatIntegrationEventRequest::destinationId))
.setter(setter(Builder::destinationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationId").build()).build();
private static final SdkField SUBTYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Subtype")
.getter(getter(SendChatIntegrationEventRequest::subtype)).setter(setter(Builder::subtype))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Subtype").build()).build();
private static final SdkField EVENT_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Event").getter(getter(SendChatIntegrationEventRequest::event)).setter(setter(Builder::event))
.constructor(ChatEvent::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Event").build()).build();
private static final SdkField NEW_SESSION_DETAILS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NewSessionDetails")
.getter(getter(SendChatIntegrationEventRequest::newSessionDetails)).setter(setter(Builder::newSessionDetails))
.constructor(NewSessionDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewSessionDetails").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_ID_FIELD,
DESTINATION_ID_FIELD, SUBTYPE_FIELD, EVENT_FIELD, NEW_SESSION_DETAILS_FIELD));
private final String sourceId;
private final String destinationId;
private final String subtype;
private final ChatEvent event;
private final NewSessionDetails newSessionDetails;
private SendChatIntegrationEventRequest(BuilderImpl builder) {
super(builder);
this.sourceId = builder.sourceId;
this.destinationId = builder.destinationId;
this.subtype = builder.subtype;
this.event = builder.event;
this.newSessionDetails = builder.newSessionDetails;
}
/**
*
* External identifier of chat customer participant, used in part to uniquely identify a chat. For SMS, this is the
* E164 phone number of the chat customer participant.
*
*
* @return External identifier of chat customer participant, used in part to uniquely identify a chat. For SMS, this
* is the E164 phone number of the chat customer participant.
*/
public final String sourceId() {
return sourceId;
}
/**
*
* Chat system identifier, used in part to uniquely identify chat. This is associated with the Amazon Connect
* instance and flow to be used to start chats. For SMS, this is the phone number destination of inbound SMS
* messages represented by an Amazon Pinpoint phone number ARN.
*
*
* @return Chat system identifier, used in part to uniquely identify chat. This is associated with the Amazon
* Connect instance and flow to be used to start chats. For SMS, this is the phone number destination of
* inbound SMS messages represented by an Amazon Pinpoint phone number ARN.
*/
public final String destinationId() {
return destinationId;
}
/**
*
* Classification of a channel. This is used in part to uniquely identify chat.
*
*
* Valid value: ["connect:sms"]
*
*
* @return Classification of a channel. This is used in part to uniquely identify chat.
*
* Valid value: ["connect:sms"]
*/
public final String subtype() {
return subtype;
}
/**
*
* Chat integration event payload
*
*
* @return Chat integration event payload
*/
public final ChatEvent event() {
return event;
}
/**
*
* Contact properties to apply when starting a new chat. If the integration event is handled with an existing chat,
* this is ignored.
*
*
* @return Contact properties to apply when starting a new chat. If the integration event is handled with an
* existing chat, this is ignored.
*/
public final NewSessionDetails newSessionDetails() {
return newSessionDetails;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(sourceId());
hashCode = 31 * hashCode + Objects.hashCode(destinationId());
hashCode = 31 * hashCode + Objects.hashCode(subtype());
hashCode = 31 * hashCode + Objects.hashCode(event());
hashCode = 31 * hashCode + Objects.hashCode(newSessionDetails());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SendChatIntegrationEventRequest)) {
return false;
}
SendChatIntegrationEventRequest other = (SendChatIntegrationEventRequest) obj;
return Objects.equals(sourceId(), other.sourceId()) && Objects.equals(destinationId(), other.destinationId())
&& Objects.equals(subtype(), other.subtype()) && Objects.equals(event(), other.event())
&& Objects.equals(newSessionDetails(), other.newSessionDetails());
}
/**
* 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("SendChatIntegrationEventRequest").add("SourceId", sourceId())
.add("DestinationId", destinationId()).add("Subtype", subtype()).add("Event", event())
.add("NewSessionDetails", newSessionDetails()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SourceId":
return Optional.ofNullable(clazz.cast(sourceId()));
case "DestinationId":
return Optional.ofNullable(clazz.cast(destinationId()));
case "Subtype":
return Optional.ofNullable(clazz.cast(subtype()));
case "Event":
return Optional.ofNullable(clazz.cast(event()));
case "NewSessionDetails":
return Optional.ofNullable(clazz.cast(newSessionDetails()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function