Search in sources :

Example 96 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class DialogActionJsonUnmarshaller method unmarshall.

public DialogAction unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    DialogAction dialogAction = new DialogAction();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("type")) {
            dialogAction.setType(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("intentName")) {
            dialogAction.setIntentName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("slots")) {
            dialogAction.setSlots(new MapUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("slotToElicit")) {
            dialogAction.setSlotToElicit(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("fulfillmentState")) {
            dialogAction.setFulfillmentState(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("message")) {
            dialogAction.setMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("messageFormat")) {
            dialogAction.setMessageFormat(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return dialogAction;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 97 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class GetSessionResultJsonUnmarshaller method unmarshall.

public GetSessionResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetSessionResult getSessionResult = new GetSessionResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("recentIntentSummaryView")) {
            getSessionResult.setRecentIntentSummaryView(new ListUnmarshaller<IntentSummary>(IntentSummaryJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("sessionAttributes")) {
            getSessionResult.setSessionAttributes(new MapUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("sessionId")) {
            getSessionResult.setSessionId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("dialogAction")) {
            getSessionResult.setDialogAction(DialogActionJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("activeContexts")) {
            getSessionResult.setActiveContexts(new ListUnmarshaller<ActiveContext>(ActiveContextJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getSessionResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 98 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class ActiveContextTimeToLiveJsonUnmarshaller method unmarshall.

public ActiveContextTimeToLive unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    ActiveContextTimeToLive activeContextTimeToLive = new ActiveContextTimeToLive();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("timeToLiveInSeconds")) {
            activeContextTimeToLive.setTimeToLiveInSeconds(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("turnsToLive")) {
            activeContextTimeToLive.setTurnsToLive(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return activeContextTimeToLive;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 99 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class CreateGeofenceCollectionResultJsonUnmarshaller method unmarshall.

public CreateGeofenceCollectionResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateGeofenceCollectionResult createGeofenceCollectionResult = new CreateGeofenceCollectionResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("CollectionArn")) {
            createGeofenceCollectionResult.setCollectionArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CollectionName")) {
            createGeofenceCollectionResult.setCollectionName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CreateTime")) {
            createGeofenceCollectionResult.setCreateTime(DateJsonUnmarshaller.getInstance(TimestampFormat.ISO_8601).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createGeofenceCollectionResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 100 with AwsJsonReader

use of com.amazonaws.util.json.AwsJsonReader in project aws-sdk-android by aws-amplify.

the class CreateMapResultJsonUnmarshaller method unmarshall.

public CreateMapResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    CreateMapResult createMapResult = new CreateMapResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("CreateTime")) {
            createMapResult.setCreateTime(DateJsonUnmarshaller.getInstance(TimestampFormat.ISO_8601).unmarshall(context));
        } else if (name.equals("MapArn")) {
            createMapResult.setMapArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MapName")) {
            createMapResult.setMapName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return createMapResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Aggregations

AwsJsonReader (com.amazonaws.util.json.AwsJsonReader)1687 StringReader (java.io.StringReader)19 AwsJsonWriter (com.amazonaws.util.json.AwsJsonWriter)14 StringWriter (java.io.StringWriter)14 Test (org.junit.Test)14 JsonUnmarshallerContext (com.amazonaws.transform.JsonUnmarshallerContext)5 Date (java.util.Date)4 ListUnmarshaller (com.amazonaws.transform.ListUnmarshaller)3 HashMap (java.util.HashMap)3 IOException (java.io.IOException)2 BigInteger (java.math.BigInteger)2 AmazonWebServiceResponse (com.amazonaws.AmazonWebServiceResponse)1 ResponseMetadata (com.amazonaws.ResponseMetadata)1 CRC32MismatchException (com.amazonaws.internal.CRC32MismatchException)1 InvalidContactFlowException (com.amazonaws.services.connect.model.InvalidContactFlowException)1 InvalidContactFlowModuleException (com.amazonaws.services.connect.model.InvalidContactFlowModuleException)1 ValidationException (com.amazonaws.services.geo.model.ValidationException)1 CRC32ChecksumCalculatingInputStream (com.amazonaws.util.CRC32ChecksumCalculatingInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1