All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.supplychain.model.SendDataIntegrationEventRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Supply Chain module holds the client classes that are used for communicating with Supply Chain.

There is a newer version: 2.28.4
Show 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.supplychain.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.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.DefaultValueTrait;
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;

/**
 * 

* The request parameters for SendDataIntegrationEvent. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SendDataIntegrationEventRequest extends SupplyChainRequest implements ToCopyableBuilder { private static final SdkField INSTANCE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("instanceId").getter(getter(SendDataIntegrationEventRequest::instanceId)) .setter(setter(Builder::instanceId)) .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("instanceId").build()).build(); private static final SdkField EVENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("eventType").getter(getter(SendDataIntegrationEventRequest::eventTypeAsString)) .setter(setter(Builder::eventType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eventType").build()).build(); private static final SdkField DATA_FIELD = SdkField. builder(MarshallingType.STRING).memberName("data") .getter(getter(SendDataIntegrationEventRequest::data)).setter(setter(Builder::data)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("data").build()).build(); private static final SdkField EVENT_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("eventGroupId").getter(getter(SendDataIntegrationEventRequest::eventGroupId)) .setter(setter(Builder::eventGroupId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eventGroupId").build()).build(); private static final SdkField EVENT_TIMESTAMP_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("eventTimestamp") .getter(getter(SendDataIntegrationEventRequest::eventTimestamp)) .setter(setter(Builder::eventTimestamp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("eventTimestamp").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.UNIX_TIMESTAMP)).build(); private static final SdkField CLIENT_TOKEN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("clientToken") .getter(getter(SendDataIntegrationEventRequest::clientToken)) .setter(setter(Builder::clientToken)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientToken").build(), DefaultValueTrait.idempotencyToken()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INSTANCE_ID_FIELD, EVENT_TYPE_FIELD, DATA_FIELD, EVENT_GROUP_ID_FIELD, EVENT_TIMESTAMP_FIELD, CLIENT_TOKEN_FIELD)); private final String instanceId; private final String eventType; private final String data; private final String eventGroupId; private final Instant eventTimestamp; private final String clientToken; private SendDataIntegrationEventRequest(BuilderImpl builder) { super(builder); this.instanceId = builder.instanceId; this.eventType = builder.eventType; this.data = builder.data; this.eventGroupId = builder.eventGroupId; this.eventTimestamp = builder.eventTimestamp; this.clientToken = builder.clientToken; } /** *

* The AWS Supply Chain instance identifier. *

* * @return The AWS Supply Chain instance identifier. */ public final String instanceId() { return instanceId; } /** *

* The data event type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #eventType} will * return {@link DataIntegrationEventType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #eventTypeAsString}. *

* * @return The data event type. * @see DataIntegrationEventType */ public final DataIntegrationEventType eventType() { return DataIntegrationEventType.fromValue(eventType); } /** *

* The data event type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #eventType} will * return {@link DataIntegrationEventType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #eventTypeAsString}. *

* * @return The data event type. * @see DataIntegrationEventType */ public final String eventTypeAsString() { return eventType; } /** *

* The data payload of the event. For more information on the data schema to use, see Data entities supported * in AWS Supply Chain . *

* * @return The data payload of the event. For more information on the data schema to use, see Data entities * supported in AWS Supply Chain . */ public final String data() { return data; } /** *

* Event identifier (for example, orderId for InboundOrder) used for data sharing or partitioning. *

* * @return Event identifier (for example, orderId for InboundOrder) used for data sharing or partitioning. */ public final String eventGroupId() { return eventGroupId; } /** *

* The event timestamp (in epoch seconds). *

* * @return The event timestamp (in epoch seconds). */ public final Instant eventTimestamp() { return eventTimestamp; } /** *

* The idempotent client token. *

* * @return The idempotent client token. */ public final String clientToken() { return clientToken; } @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(instanceId()); hashCode = 31 * hashCode + Objects.hashCode(eventTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(data()); hashCode = 31 * hashCode + Objects.hashCode(eventGroupId()); hashCode = 31 * hashCode + Objects.hashCode(eventTimestamp()); hashCode = 31 * hashCode + Objects.hashCode(clientToken()); 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 SendDataIntegrationEventRequest)) { return false; } SendDataIntegrationEventRequest other = (SendDataIntegrationEventRequest) obj; return Objects.equals(instanceId(), other.instanceId()) && Objects.equals(eventTypeAsString(), other.eventTypeAsString()) && Objects.equals(data(), other.data()) && Objects.equals(eventGroupId(), other.eventGroupId()) && Objects.equals(eventTimestamp(), other.eventTimestamp()) && Objects.equals(clientToken(), other.clientToken()); } /** * 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("SendDataIntegrationEventRequest").add("InstanceId", instanceId()) .add("EventType", eventTypeAsString()).add("Data", data() == null ? null : "*** Sensitive Data Redacted ***") .add("EventGroupId", eventGroupId()).add("EventTimestamp", eventTimestamp()).add("ClientToken", clientToken()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "instanceId": return Optional.ofNullable(clazz.cast(instanceId())); case "eventType": return Optional.ofNullable(clazz.cast(eventTypeAsString())); case "data": return Optional.ofNullable(clazz.cast(data())); case "eventGroupId": return Optional.ofNullable(clazz.cast(eventGroupId())); case "eventTimestamp": return Optional.ofNullable(clazz.cast(eventTimestamp())); case "clientToken": return Optional.ofNullable(clazz.cast(clientToken())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SendDataIntegrationEventRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SupplyChainRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The AWS Supply Chain instance identifier. *

* * @param instanceId * The AWS Supply Chain instance identifier. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceId(String instanceId); /** *

* The data event type. *

* * @param eventType * The data event type. * @see DataIntegrationEventType * @return Returns a reference to this object so that method calls can be chained together. * @see DataIntegrationEventType */ Builder eventType(String eventType); /** *

* The data event type. *

* * @param eventType * The data event type. * @see DataIntegrationEventType * @return Returns a reference to this object so that method calls can be chained together. * @see DataIntegrationEventType */ Builder eventType(DataIntegrationEventType eventType); /** *

* The data payload of the event. For more information on the data schema to use, see Data entities * supported in AWS Supply Chain . *

* * @param data * The data payload of the event. For more information on the data schema to use, see Data entities * supported in AWS Supply Chain . * @return Returns a reference to this object so that method calls can be chained together. */ Builder data(String data); /** *

* Event identifier (for example, orderId for InboundOrder) used for data sharing or partitioning. *

* * @param eventGroupId * Event identifier (for example, orderId for InboundOrder) used for data sharing or partitioning. * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventGroupId(String eventGroupId); /** *

* The event timestamp (in epoch seconds). *

* * @param eventTimestamp * The event timestamp (in epoch seconds). * @return Returns a reference to this object so that method calls can be chained together. */ Builder eventTimestamp(Instant eventTimestamp); /** *

* The idempotent client token. *

* * @param clientToken * The idempotent client token. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientToken(String clientToken); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SupplyChainRequest.BuilderImpl implements Builder { private String instanceId; private String eventType; private String data; private String eventGroupId; private Instant eventTimestamp; private String clientToken; private BuilderImpl() { } private BuilderImpl(SendDataIntegrationEventRequest model) { super(model); instanceId(model.instanceId); eventType(model.eventType); data(model.data); eventGroupId(model.eventGroupId); eventTimestamp(model.eventTimestamp); clientToken(model.clientToken); } public final String getInstanceId() { return instanceId; } public final void setInstanceId(String instanceId) { this.instanceId = instanceId; } @Override public final Builder instanceId(String instanceId) { this.instanceId = instanceId; return this; } public final String getEventType() { return eventType; } public final void setEventType(String eventType) { this.eventType = eventType; } @Override public final Builder eventType(String eventType) { this.eventType = eventType; return this; } @Override public final Builder eventType(DataIntegrationEventType eventType) { this.eventType(eventType == null ? null : eventType.toString()); return this; } public final String getData() { return data; } public final void setData(String data) { this.data = data; } @Override public final Builder data(String data) { this.data = data; return this; } public final String getEventGroupId() { return eventGroupId; } public final void setEventGroupId(String eventGroupId) { this.eventGroupId = eventGroupId; } @Override public final Builder eventGroupId(String eventGroupId) { this.eventGroupId = eventGroupId; return this; } public final Instant getEventTimestamp() { return eventTimestamp; } public final void setEventTimestamp(Instant eventTimestamp) { this.eventTimestamp = eventTimestamp; } @Override public final Builder eventTimestamp(Instant eventTimestamp) { this.eventTimestamp = eventTimestamp; return this; } public final String getClientToken() { return clientToken; } public final void setClientToken(String clientToken) { this.clientToken = clientToken; } @Override public final Builder clientToken(String clientToken) { this.clientToken = clientToken; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public SendDataIntegrationEventRequest build() { return new SendDataIntegrationEventRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy