software.amazon.awssdk.services.eventbridge.model.StartReplayRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eventbridge Show documentation
Show all versions of eventbridge Show documentation
The AWS Java SDK for EventBridge module holds the client classes that are used for
communicating with EventBridge.
The newest version!
/*
* 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.eventbridge.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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.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 StartReplayRequest extends EventBridgeRequest implements
ToCopyableBuilder {
private static final SdkField REPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplayName").getter(getter(StartReplayRequest::replayName)).setter(setter(Builder::replayName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplayName").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(StartReplayRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField EVENT_SOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EventSourceArn").getter(getter(StartReplayRequest::eventSourceArn))
.setter(setter(Builder::eventSourceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventSourceArn").build()).build();
private static final SdkField EVENT_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("EventStartTime").getter(getter(StartReplayRequest::eventStartTime))
.setter(setter(Builder::eventStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventStartTime").build()).build();
private static final SdkField EVENT_END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("EventEndTime").getter(getter(StartReplayRequest::eventEndTime)).setter(setter(Builder::eventEndTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EventEndTime").build()).build();
private static final SdkField DESTINATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Destination")
.getter(getter(StartReplayRequest::destination)).setter(setter(Builder::destination))
.constructor(ReplayDestination::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Destination").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPLAY_NAME_FIELD,
DESCRIPTION_FIELD, EVENT_SOURCE_ARN_FIELD, EVENT_START_TIME_FIELD, EVENT_END_TIME_FIELD, DESTINATION_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String replayName;
private final String description;
private final String eventSourceArn;
private final Instant eventStartTime;
private final Instant eventEndTime;
private final ReplayDestination destination;
private StartReplayRequest(BuilderImpl builder) {
super(builder);
this.replayName = builder.replayName;
this.description = builder.description;
this.eventSourceArn = builder.eventSourceArn;
this.eventStartTime = builder.eventStartTime;
this.eventEndTime = builder.eventEndTime;
this.destination = builder.destination;
}
/**
*
* The name of the replay to start.
*
*
* @return The name of the replay to start.
*/
public final String replayName() {
return replayName;
}
/**
*
* A description for the replay to start.
*
*
* @return A description for the replay to start.
*/
public final String description() {
return description;
}
/**
*
* The ARN of the archive to replay events from.
*
*
* @return The ARN of the archive to replay events from.
*/
public final String eventSourceArn() {
return eventSourceArn;
}
/**
*
* A time stamp for the time to start replaying events. Only events that occurred between the
* EventStartTime
and EventEndTime
are replayed.
*
*
* @return A time stamp for the time to start replaying events. Only events that occurred between the
* EventStartTime
and EventEndTime
are replayed.
*/
public final Instant eventStartTime() {
return eventStartTime;
}
/**
*
* A time stamp for the time to stop replaying events. Only events that occurred between the
* EventStartTime
and EventEndTime
are replayed.
*
*
* @return A time stamp for the time to stop replaying events. Only events that occurred between the
* EventStartTime
and EventEndTime
are replayed.
*/
public final Instant eventEndTime() {
return eventEndTime;
}
/**
*
* A ReplayDestination
object that includes details about the destination for the replay.
*
*
* @return A ReplayDestination
object that includes details about the destination for the replay.
*/
public final ReplayDestination destination() {
return destination;
}
@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(replayName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(eventSourceArn());
hashCode = 31 * hashCode + Objects.hashCode(eventStartTime());
hashCode = 31 * hashCode + Objects.hashCode(eventEndTime());
hashCode = 31 * hashCode + Objects.hashCode(destination());
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 StartReplayRequest)) {
return false;
}
StartReplayRequest other = (StartReplayRequest) obj;
return Objects.equals(replayName(), other.replayName()) && Objects.equals(description(), other.description())
&& Objects.equals(eventSourceArn(), other.eventSourceArn())
&& Objects.equals(eventStartTime(), other.eventStartTime())
&& Objects.equals(eventEndTime(), other.eventEndTime()) && Objects.equals(destination(), other.destination());
}
/**
* 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("StartReplayRequest").add("ReplayName", replayName()).add("Description", description())
.add("EventSourceArn", eventSourceArn()).add("EventStartTime", eventStartTime())
.add("EventEndTime", eventEndTime()).add("Destination", destination()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplayName":
return Optional.ofNullable(clazz.cast(replayName()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "EventSourceArn":
return Optional.ofNullable(clazz.cast(eventSourceArn()));
case "EventStartTime":
return Optional.ofNullable(clazz.cast(eventStartTime()));
case "EventEndTime":
return Optional.ofNullable(clazz.cast(eventEndTime()));
case "Destination":
return Optional.ofNullable(clazz.cast(destination()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("ReplayName", REPLAY_NAME_FIELD);
map.put("Description", DESCRIPTION_FIELD);
map.put("EventSourceArn", EVENT_SOURCE_ARN_FIELD);
map.put("EventStartTime", EVENT_START_TIME_FIELD);
map.put("EventEndTime", EVENT_END_TIME_FIELD);
map.put("Destination", DESTINATION_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy