Search in sources :

Example 86 with AwsJsonReader

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

the class DescribeKeyResultJsonUnmarshaller method unmarshall.

public DescribeKeyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DescribeKeyResult describeKeyResult = new DescribeKeyResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("KeyMetadata")) {
            describeKeyResult.setKeyMetadata(KeyMetadataJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return describeKeyResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 87 with AwsJsonReader

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

the class ListKeyPoliciesResultJsonUnmarshaller method unmarshall.

public ListKeyPoliciesResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListKeyPoliciesResult listKeyPoliciesResult = new ListKeyPoliciesResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("PolicyNames")) {
            listKeyPoliciesResult.setPolicyNames(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("NextMarker")) {
            listKeyPoliciesResult.setNextMarker(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Truncated")) {
            listKeyPoliciesResult.setTruncated(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return listKeyPoliciesResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 88 with AwsJsonReader

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

the class ListRetirableGrantsResultJsonUnmarshaller method unmarshall.

public ListRetirableGrantsResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    ListRetirableGrantsResult listRetirableGrantsResult = new ListRetirableGrantsResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Grants")) {
            listRetirableGrantsResult.setGrants(new ListUnmarshaller<GrantListEntry>(GrantListEntryJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("NextMarker")) {
            listRetirableGrantsResult.setNextMarker(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Truncated")) {
            listRetirableGrantsResult.setTruncated(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return listRetirableGrantsResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 89 with AwsJsonReader

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

the class GenerateRandomResultJsonUnmarshaller method unmarshall.

public GenerateRandomResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GenerateRandomResult generateRandomResult = new GenerateRandomResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Plaintext")) {
            generateRandomResult.setPlaintext(ByteBufferJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return generateRandomResult;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 90 with AwsJsonReader

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

the class GetKeyPolicyResultJsonUnmarshaller method unmarshall.

public GetKeyPolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    GetKeyPolicyResult getKeyPolicyResult = new GetKeyPolicyResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Policy")) {
            getKeyPolicyResult.setPolicy(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return getKeyPolicyResult;
}
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