Search in sources :

Example 76 with AwsJsonReader

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

the class TagJsonUnmarshaller method unmarshall.

public Tag unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    Tag tag = new Tag();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Key")) {
            tag.setKey(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Value")) {
            tag.setValue(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return tag;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 77 with AwsJsonReader

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

the class GenerateDataKeyPairResultJsonUnmarshaller method unmarshall.

public GenerateDataKeyPairResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GenerateDataKeyPairResult generateDataKeyPairResult = new GenerateDataKeyPairResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("PrivateKeyCiphertextBlob")) {
            generateDataKeyPairResult.setPrivateKeyCiphertextBlob(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("PrivateKeyPlaintext")) {
            generateDataKeyPairResult.setPrivateKeyPlaintext(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("PublicKey")) {
            generateDataKeyPairResult.setPublicKey(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyId")) {
            generateDataKeyPairResult.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyPairSpec")) {
            generateDataKeyPairResult.setKeyPairSpec(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return generateDataKeyPairResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 78 with AwsJsonReader

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

the class GenerateDataKeyPairWithoutPlaintextResultJsonUnmarshaller method unmarshall.

public GenerateDataKeyPairWithoutPlaintextResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GenerateDataKeyPairWithoutPlaintextResult generateDataKeyPairWithoutPlaintextResult = new GenerateDataKeyPairWithoutPlaintextResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("PrivateKeyCiphertextBlob")) {
            generateDataKeyPairWithoutPlaintextResult.setPrivateKeyCiphertextBlob(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("PublicKey")) {
            generateDataKeyPairWithoutPlaintextResult.setPublicKey(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyId")) {
            generateDataKeyPairWithoutPlaintextResult.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyPairSpec")) {
            generateDataKeyPairWithoutPlaintextResult.setKeyPairSpec(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return generateDataKeyPairWithoutPlaintextResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 79 with AwsJsonReader

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

the class GenerateDataKeyWithoutPlaintextResultJsonUnmarshaller method unmarshall.

public GenerateDataKeyWithoutPlaintextResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GenerateDataKeyWithoutPlaintextResult generateDataKeyWithoutPlaintextResult = new GenerateDataKeyWithoutPlaintextResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("CiphertextBlob")) {
            generateDataKeyWithoutPlaintextResult.setCiphertextBlob(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyId")) {
            generateDataKeyWithoutPlaintextResult.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return generateDataKeyWithoutPlaintextResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 80 with AwsJsonReader

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

the class KeyListEntryJsonUnmarshaller method unmarshall.

public KeyListEntry unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    KeyListEntry keyListEntry = new KeyListEntry();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("KeyId")) {
            keyListEntry.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyArn")) {
            keyListEntry.setKeyArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return keyListEntry;
}
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