software.amazon.awssdk.services.dataexchange.model.UpdateEventActionResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dataexchange Show documentation
Show all versions of dataexchange Show documentation
The AWS Java SDK for DataExchange module holds the client classes that are used for
communicating with DataExchange.
/*
* 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.dataexchange.model;
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.core.traits.TimestampFormatTrait;
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 UpdateEventActionResponse extends DataExchangeResponse implements
ToCopyableBuilder {
private static final SdkField ACTION_FIELD = SdkField. builder(MarshallingType.SDK_POJO).memberName("Action")
.getter(getter(UpdateEventActionResponse::action)).setter(setter(Builder::action)).constructor(Action::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Action").build()).build();
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn")
.getter(getter(UpdateEventActionResponse::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("CreatedAt")
.getter(getter(UpdateEventActionResponse::createdAt))
.setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final SdkField EVENT_FIELD = SdkField. builder(MarshallingType.SDK_POJO).memberName("Event")
.getter(getter(UpdateEventActionResponse::event)).setter(setter(Builder::event)).constructor(Event::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Event").build()).build();
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id")
.getter(getter(UpdateEventActionResponse::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();
private static final SdkField UPDATED_AT_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("UpdatedAt")
.getter(getter(UpdateEventActionResponse::updatedAt))
.setter(setter(Builder::updatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdatedAt").build(),
TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_FIELD, ARN_FIELD,
CREATED_AT_FIELD, EVENT_FIELD, ID_FIELD, UPDATED_AT_FIELD));
private final Action action;
private final String arn;
private final Instant createdAt;
private final Event event;
private final String id;
private final Instant updatedAt;
private UpdateEventActionResponse(BuilderImpl builder) {
super(builder);
this.action = builder.action;
this.arn = builder.arn;
this.createdAt = builder.createdAt;
this.event = builder.event;
this.id = builder.id;
this.updatedAt = builder.updatedAt;
}
/**
*
* What occurs after a certain event.
*
*
* @return What occurs after a certain event.
*/
public final Action action() {
return action;
}
/**
*
* The ARN for the event action.
*
*
* @return The ARN for the event action.
*/
public final String arn() {
return arn;
}
/**
*
* The date and time that the event action was created, in ISO 8601 format.
*
*
* @return The date and time that the event action was created, in ISO 8601 format.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* What occurs to start an action.
*
*
* @return What occurs to start an action.
*/
public final Event event() {
return event;
}
/**
*
* The unique identifier for the event action.
*
*
* @return The unique identifier for the event action.
*/
public final String id() {
return id;
}
/**
*
* The date and time that the event action was last updated, in ISO 8601 format.
*
*
* @return The date and time that the event action was last updated, in ISO 8601 format.
*/
public final Instant updatedAt() {
return updatedAt;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(action());
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(event());
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(updatedAt());
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 UpdateEventActionResponse)) {
return false;
}
UpdateEventActionResponse other = (UpdateEventActionResponse) obj;
return Objects.equals(action(), other.action()) && Objects.equals(arn(), other.arn())
&& Objects.equals(createdAt(), other.createdAt()) && Objects.equals(event(), other.event())
&& Objects.equals(id(), other.id()) && Objects.equals(updatedAt(), other.updatedAt());
}
/**
* 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("UpdateEventActionResponse").add("Action", action()).add("Arn", arn())
.add("CreatedAt", createdAt()).add("Event", event()).add("Id", id()).add("UpdatedAt", updatedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Action":
return Optional.ofNullable(clazz.cast(action()));
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "Event":
return Optional.ofNullable(clazz.cast(event()));
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "UpdatedAt":
return Optional.ofNullable(clazz.cast(updatedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function