software.amazon.awssdk.services.sfn.transform.HistoryEventMarshaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stepfunctions Show documentation
Show all versions of stepfunctions Show documentation
The AWS Java SDK for AWS Step Functions module holds the client classes that are used for communicating
with AWS Step Functions.
/*
* Copyright 2012-2017 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.sfn.transform;
import javax.annotation.Generated;
import software.amazon.awssdk.SdkClientException;
import software.amazon.awssdk.services.sfn.model.*;
import software.amazon.awssdk.protocol.*;
import software.amazon.awssdk.annotation.SdkInternalApi;
/**
* HistoryEventMarshaller
*/
@Generated("software.amazon.awssdk:aws-java-sdk-code-generator")
@SdkInternalApi
public class HistoryEventMarshaller {
private static final MarshallingInfo TIMESTAMP_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("timestamp").build();
private static final MarshallingInfo TYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("type").build();
private static final MarshallingInfo ID_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("id").build();
private static final MarshallingInfo PREVIOUSEVENTID_BINDING = MarshallingInfo.builder(MarshallingType.LONG)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("previousEventId").build();
private static final MarshallingInfo ACTIVITYFAILEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("activityFailedEventDetails").build();
private static final MarshallingInfo ACTIVITYSCHEDULEFAILEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("activityScheduleFailedEventDetails").build();
private static final MarshallingInfo ACTIVITYSCHEDULEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("activityScheduledEventDetails").build();
private static final MarshallingInfo ACTIVITYSTARTEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("activityStartedEventDetails").build();
private static final MarshallingInfo ACTIVITYSUCCEEDEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("activitySucceededEventDetails").build();
private static final MarshallingInfo ACTIVITYTIMEDOUTEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("activityTimedOutEventDetails").build();
private static final MarshallingInfo EXECUTIONFAILEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("executionFailedEventDetails").build();
private static final MarshallingInfo EXECUTIONSTARTEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("executionStartedEventDetails").build();
private static final MarshallingInfo EXECUTIONSUCCEEDEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("executionSucceededEventDetails").build();
private static final MarshallingInfo EXECUTIONABORTEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("executionAbortedEventDetails").build();
private static final MarshallingInfo EXECUTIONTIMEDOUTEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("executionTimedOutEventDetails").build();
private static final MarshallingInfo LAMBDAFUNCTIONFAILEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("lambdaFunctionFailedEventDetails").build();
private static final MarshallingInfo LAMBDAFUNCTIONSCHEDULEFAILEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("lambdaFunctionScheduleFailedEventDetails").build();
private static final MarshallingInfo LAMBDAFUNCTIONSCHEDULEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("lambdaFunctionScheduledEventDetails").build();
private static final MarshallingInfo LAMBDAFUNCTIONSTARTFAILEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("lambdaFunctionStartFailedEventDetails").build();
private static final MarshallingInfo LAMBDAFUNCTIONSUCCEEDEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("lambdaFunctionSucceededEventDetails").build();
private static final MarshallingInfo LAMBDAFUNCTIONTIMEDOUTEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("lambdaFunctionTimedOutEventDetails").build();
private static final MarshallingInfo STATEENTEREDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("stateEnteredEventDetails").build();
private static final MarshallingInfo STATEEXITEDEVENTDETAILS_BINDING = MarshallingInfo
.builder(MarshallingType.STRUCTURED).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("stateExitedEventDetails").build();
private static final HistoryEventMarshaller instance = new HistoryEventMarshaller();
public static HistoryEventMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(HistoryEvent historyEvent, ProtocolMarshaller protocolMarshaller) {
if (historyEvent == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(historyEvent.timestamp(), TIMESTAMP_BINDING);
protocolMarshaller.marshall(historyEvent.type(), TYPE_BINDING);
protocolMarshaller.marshall(historyEvent.id(), ID_BINDING);
protocolMarshaller.marshall(historyEvent.previousEventId(), PREVIOUSEVENTID_BINDING);
protocolMarshaller.marshall(historyEvent.activityFailedEventDetails(), ACTIVITYFAILEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.activityScheduleFailedEventDetails(),
ACTIVITYSCHEDULEFAILEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.activityScheduledEventDetails(), ACTIVITYSCHEDULEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.activityStartedEventDetails(), ACTIVITYSTARTEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.activitySucceededEventDetails(), ACTIVITYSUCCEEDEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.activityTimedOutEventDetails(), ACTIVITYTIMEDOUTEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.executionFailedEventDetails(), EXECUTIONFAILEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.executionStartedEventDetails(), EXECUTIONSTARTEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.executionSucceededEventDetails(), EXECUTIONSUCCEEDEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.executionAbortedEventDetails(), EXECUTIONABORTEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.executionTimedOutEventDetails(), EXECUTIONTIMEDOUTEVENTDETAILS_BINDING);
protocolMarshaller
.marshall(historyEvent.lambdaFunctionFailedEventDetails(), LAMBDAFUNCTIONFAILEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.lambdaFunctionScheduleFailedEventDetails(),
LAMBDAFUNCTIONSCHEDULEFAILEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.lambdaFunctionScheduledEventDetails(),
LAMBDAFUNCTIONSCHEDULEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.lambdaFunctionStartFailedEventDetails(),
LAMBDAFUNCTIONSTARTFAILEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.lambdaFunctionSucceededEventDetails(),
LAMBDAFUNCTIONSUCCEEDEDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.lambdaFunctionTimedOutEventDetails(),
LAMBDAFUNCTIONTIMEDOUTEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.stateEnteredEventDetails(), STATEENTEREDEVENTDETAILS_BINDING);
protocolMarshaller.marshall(historyEvent.stateExitedEventDetails(), STATEEXITEDEVENTDETAILS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}