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

software.amazon.awssdk.services.sfn.transform.HistoryEventUnmarshaller Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.0.0-preview-11
Show newest version
/*
 * 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 java.math.*;

import javax.annotation.Generated;

import software.amazon.awssdk.services.sfn.model.*;
import software.amazon.awssdk.core.runtime.transform.SimpleTypeJsonUnmarshallers.*;
import software.amazon.awssdk.core.runtime.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * HistoryEvent JSON Unmarshaller
 */
@Generated("software.amazon.awssdk:aws-java-sdk-code-generator")
public class HistoryEventUnmarshaller implements Unmarshaller {

    public HistoryEvent unmarshall(JsonUnmarshallerContext context) throws Exception {
        HistoryEvent.Builder historyEventBuilder = HistoryEvent.builder();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("timestamp", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.timestamp(context.getUnmarshaller(java.time.Instant.class).unmarshall(context));
                }
                if (context.testExpression("type", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.type(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("id", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.id(context.getUnmarshaller(Long.class).unmarshall(context));
                }
                if (context.testExpression("previousEventId", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.previousEventId(context.getUnmarshaller(Long.class).unmarshall(context));
                }
                if (context.testExpression("activityFailedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.activityFailedEventDetails(ActivityFailedEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("activityScheduleFailedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.activityScheduleFailedEventDetails(ActivityScheduleFailedEventDetailsUnmarshaller
                            .getInstance().unmarshall(context));
                }
                if (context.testExpression("activityScheduledEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.activityScheduledEventDetails(ActivityScheduledEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("activityStartedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.activityStartedEventDetails(ActivityStartedEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("activitySucceededEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.activitySucceededEventDetails(ActivitySucceededEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("activityTimedOutEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.activityTimedOutEventDetails(ActivityTimedOutEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("executionFailedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.executionFailedEventDetails(ExecutionFailedEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("executionStartedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.executionStartedEventDetails(ExecutionStartedEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("executionSucceededEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.executionSucceededEventDetails(ExecutionSucceededEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("executionAbortedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.executionAbortedEventDetails(ExecutionAbortedEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("executionTimedOutEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.executionTimedOutEventDetails(ExecutionTimedOutEventDetailsUnmarshaller.getInstance()
                            .unmarshall(context));
                }
                if (context.testExpression("lambdaFunctionFailedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.lambdaFunctionFailedEventDetails(LambdaFunctionFailedEventDetailsUnmarshaller
                            .getInstance().unmarshall(context));
                }
                if (context.testExpression("lambdaFunctionScheduleFailedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder
                            .lambdaFunctionScheduleFailedEventDetails(LambdaFunctionScheduleFailedEventDetailsUnmarshaller
                                    .getInstance().unmarshall(context));
                }
                if (context.testExpression("lambdaFunctionScheduledEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.lambdaFunctionScheduledEventDetails(LambdaFunctionScheduledEventDetailsUnmarshaller
                            .getInstance().unmarshall(context));
                }
                if (context.testExpression("lambdaFunctionStartFailedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.lambdaFunctionStartFailedEventDetails(LambdaFunctionStartFailedEventDetailsUnmarshaller
                            .getInstance().unmarshall(context));
                }
                if (context.testExpression("lambdaFunctionSucceededEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.lambdaFunctionSucceededEventDetails(LambdaFunctionSucceededEventDetailsUnmarshaller
                            .getInstance().unmarshall(context));
                }
                if (context.testExpression("lambdaFunctionTimedOutEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.lambdaFunctionTimedOutEventDetails(LambdaFunctionTimedOutEventDetailsUnmarshaller
                            .getInstance().unmarshall(context));
                }
                if (context.testExpression("stateEnteredEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.stateEnteredEventDetails(StateEnteredEventDetailsUnmarshaller.getInstance().unmarshall(
                            context));
                }
                if (context.testExpression("stateExitedEventDetails", targetDepth)) {
                    context.nextToken();
                    historyEventBuilder.stateExitedEventDetails(StateExitedEventDetailsUnmarshaller.getInstance().unmarshall(
                            context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null
                        || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return historyEventBuilder.build();
    }

    private static final HistoryEventUnmarshaller INSTANCE = new HistoryEventUnmarshaller();

    public static HistoryEventUnmarshaller getInstance() {
        return INSTANCE;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy