software.amazon.awssdk.services.connectparticipant.model.GetTranscriptRequest Maven / Gradle / Ivy
Show all versions of connectparticipant 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.connectparticipant.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 GetTranscriptRequest extends ConnectParticipantRequest implements
ToCopyableBuilder {
private static final SdkField CONTACT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ContactId").getter(getter(GetTranscriptRequest::contactId)).setter(setter(Builder::contactId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContactId").build()).build();
private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxResults").getter(getter(GetTranscriptRequest::maxResults)).setter(setter(Builder::maxResults))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxResults").build()).build();
private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextToken").getter(getter(GetTranscriptRequest::nextToken)).setter(setter(Builder::nextToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();
private static final SdkField SCAN_DIRECTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ScanDirection").getter(getter(GetTranscriptRequest::scanDirectionAsString))
.setter(setter(Builder::scanDirection))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScanDirection").build()).build();
private static final SdkField SORT_ORDER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SortOrder").getter(getter(GetTranscriptRequest::sortOrderAsString)).setter(setter(Builder::sortOrder))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SortOrder").build()).build();
private static final SdkField START_POSITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("StartPosition")
.getter(getter(GetTranscriptRequest::startPosition)).setter(setter(Builder::startPosition))
.constructor(StartPosition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartPosition").build()).build();
private static final SdkField CONNECTION_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ConnectionToken").getter(getter(GetTranscriptRequest::connectionToken))
.setter(setter(Builder::connectionToken))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("X-Amz-Bearer").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONTACT_ID_FIELD,
MAX_RESULTS_FIELD, NEXT_TOKEN_FIELD, SCAN_DIRECTION_FIELD, SORT_ORDER_FIELD, START_POSITION_FIELD,
CONNECTION_TOKEN_FIELD));
private final String contactId;
private final Integer maxResults;
private final String nextToken;
private final String scanDirection;
private final String sortOrder;
private final StartPosition startPosition;
private final String connectionToken;
private GetTranscriptRequest(BuilderImpl builder) {
super(builder);
this.contactId = builder.contactId;
this.maxResults = builder.maxResults;
this.nextToken = builder.nextToken;
this.scanDirection = builder.scanDirection;
this.sortOrder = builder.sortOrder;
this.startPosition = builder.startPosition;
this.connectionToken = builder.connectionToken;
}
/**
*
* The contactId from the current contact chain for which transcript is needed.
*
*
* @return The contactId from the current contact chain for which transcript is needed.
*/
public final String contactId() {
return contactId;
}
/**
*
* The maximum number of results to return in the page. Default: 10.
*
*
* @return The maximum number of results to return in the page. Default: 10.
*/
public final Integer maxResults() {
return maxResults;
}
/**
*
* The pagination token. Use the value returned previously in the next subsequent request to retrieve the next set
* of results.
*
*
* @return The pagination token. Use the value returned previously in the next subsequent request to retrieve the
* next set of results.
*/
public final String nextToken() {
return nextToken;
}
/**
*
* The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is
* provided, FORWARD with StartPosition.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #scanDirection}
* will return {@link ScanDirection#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #scanDirectionAsString}.
*
*
* @return The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition
* is provided, FORWARD with StartPosition.
* @see ScanDirection
*/
public final ScanDirection scanDirection() {
return ScanDirection.fromValue(scanDirection);
}
/**
*
* The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition is
* provided, FORWARD with StartPosition.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #scanDirection}
* will return {@link ScanDirection#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #scanDirectionAsString}.
*
*
* @return The direction from StartPosition from which to retrieve message. Default: BACKWARD when no StartPosition
* is provided, FORWARD with StartPosition.
* @see ScanDirection
*/
public final String scanDirectionAsString() {
return scanDirection;
}
/**
*
* The sort order for the records. Default: DESCENDING.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortOrder} will
* return {@link SortKey#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortOrderAsString}.
*
*
* @return The sort order for the records. Default: DESCENDING.
* @see SortKey
*/
public final SortKey sortOrder() {
return SortKey.fromValue(sortOrder);
}
/**
*
* The sort order for the records. Default: DESCENDING.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #sortOrder} will
* return {@link SortKey#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #sortOrderAsString}.
*
*
* @return The sort order for the records. Default: DESCENDING.
* @see SortKey
*/
public final String sortOrderAsString() {
return sortOrder;
}
/**
*
* A filtering option for where to start.
*
*
* @return A filtering option for where to start.
*/
public final StartPosition startPosition() {
return startPosition;
}
/**
*
* The authentication token associated with the participant's connection.
*
*
* @return The authentication token associated with the participant's connection.
*/
public final String connectionToken() {
return connectionToken;
}
@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(contactId());
hashCode = 31 * hashCode + Objects.hashCode(maxResults());
hashCode = 31 * hashCode + Objects.hashCode(nextToken());
hashCode = 31 * hashCode + Objects.hashCode(scanDirectionAsString());
hashCode = 31 * hashCode + Objects.hashCode(sortOrderAsString());
hashCode = 31 * hashCode + Objects.hashCode(startPosition());
hashCode = 31 * hashCode + Objects.hashCode(connectionToken());
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 GetTranscriptRequest)) {
return false;
}
GetTranscriptRequest other = (GetTranscriptRequest) obj;
return Objects.equals(contactId(), other.contactId()) && Objects.equals(maxResults(), other.maxResults())
&& Objects.equals(nextToken(), other.nextToken())
&& Objects.equals(scanDirectionAsString(), other.scanDirectionAsString())
&& Objects.equals(sortOrderAsString(), other.sortOrderAsString())
&& Objects.equals(startPosition(), other.startPosition())
&& Objects.equals(connectionToken(), other.connectionToken());
}
/**
* 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("GetTranscriptRequest").add("ContactId", contactId()).add("MaxResults", maxResults())
.add("NextToken", nextToken()).add("ScanDirection", scanDirectionAsString())
.add("SortOrder", sortOrderAsString()).add("StartPosition", startPosition())
.add("ConnectionToken", connectionToken()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ContactId":
return Optional.ofNullable(clazz.cast(contactId()));
case "MaxResults":
return Optional.ofNullable(clazz.cast(maxResults()));
case "NextToken":
return Optional.ofNullable(clazz.cast(nextToken()));
case "ScanDirection":
return Optional.ofNullable(clazz.cast(scanDirectionAsString()));
case "SortOrder":
return Optional.ofNullable(clazz.cast(sortOrderAsString()));
case "StartPosition":
return Optional.ofNullable(clazz.cast(startPosition()));
case "ConnectionToken":
return Optional.ofNullable(clazz.cast(connectionToken()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function