Search in sources :

Example 91 with AwsJsonReader

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

the class GetParametersForImportResultJsonUnmarshaller method unmarshall.

public GetParametersForImportResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetParametersForImportResult getParametersForImportResult = new GetParametersForImportResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("KeyId")) {
            getParametersForImportResult.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ImportToken")) {
            getParametersForImportResult.setImportToken(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("PublicKey")) {
            getParametersForImportResult.setPublicKey(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ParametersValidTo")) {
            getParametersForImportResult.setParametersValidTo(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getParametersForImportResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 92 with AwsJsonReader

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

the class GrantListEntryJsonUnmarshaller method unmarshall.

public GrantListEntry unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    GrantListEntry grantListEntry = new GrantListEntry();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("KeyId")) {
            grantListEntry.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("GrantId")) {
            grantListEntry.setGrantId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Name")) {
            grantListEntry.setName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CreationDate")) {
            grantListEntry.setCreationDate(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("GranteePrincipal")) {
            grantListEntry.setGranteePrincipal(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("RetiringPrincipal")) {
            grantListEntry.setRetiringPrincipal(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("IssuingAccount")) {
            grantListEntry.setIssuingAccount(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Operations")) {
            grantListEntry.setOperations(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("Constraints")) {
            grantListEntry.setConstraints(GrantConstraintsJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return grantListEntry;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 93 with AwsJsonReader

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

the class VerifyResultJsonUnmarshaller method unmarshall.

public VerifyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    VerifyResult verifyResult = new VerifyResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("KeyId")) {
            verifyResult.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("SignatureValid")) {
            verifyResult.setSignatureValid(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("SigningAlgorithm")) {
            verifyResult.setSigningAlgorithm(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return verifyResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 94 with AwsJsonReader

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

the class PredictedIntentJsonUnmarshaller method unmarshall.

public PredictedIntent unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    PredictedIntent predictedIntent = new PredictedIntent();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("intentName")) {
            predictedIntent.setIntentName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("nluIntentConfidence")) {
            predictedIntent.setNluIntentConfidence(IntentConfidenceJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("slots")) {
            predictedIntent.setSlots(new MapUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return predictedIntent;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 95 with AwsJsonReader

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

the class DeleteSessionResultJsonUnmarshaller method unmarshall.

public DeleteSessionResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DeleteSessionResult deleteSessionResult = new DeleteSessionResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("botName")) {
            deleteSessionResult.setBotName(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("botAlias")) {
            deleteSessionResult.setBotAlias(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("userId")) {
            deleteSessionResult.setUserId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("sessionId")) {
            deleteSessionResult.setSessionId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return deleteSessionResult;
}
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