Search in sources :

Example 81 with AwsJsonReader

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

the class KeyMetadataJsonUnmarshaller method unmarshall.

public KeyMetadata unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    KeyMetadata keyMetadata = new KeyMetadata();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("AWSAccountId")) {
            keyMetadata.setAWSAccountId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyId")) {
            keyMetadata.setKeyId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Arn")) {
            keyMetadata.setArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CreationDate")) {
            keyMetadata.setCreationDate(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Enabled")) {
            keyMetadata.setEnabled(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Description")) {
            keyMetadata.setDescription(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyUsage")) {
            keyMetadata.setKeyUsage(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyState")) {
            keyMetadata.setKeyState(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("DeletionDate")) {
            keyMetadata.setDeletionDate(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ValidTo")) {
            keyMetadata.setValidTo(DateJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Origin")) {
            keyMetadata.setOrigin(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CustomKeyStoreId")) {
            keyMetadata.setCustomKeyStoreId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CloudHsmClusterId")) {
            keyMetadata.setCloudHsmClusterId(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("ExpirationModel")) {
            keyMetadata.setExpirationModel(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeyManager")) {
            keyMetadata.setKeyManager(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("CustomerMasterKeySpec")) {
            keyMetadata.setCustomerMasterKeySpec(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("KeySpec")) {
            keyMetadata.setKeySpec(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("EncryptionAlgorithms")) {
            keyMetadata.setEncryptionAlgorithms(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("SigningAlgorithms")) {
            keyMetadata.setSigningAlgorithms(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("MultiRegion")) {
            keyMetadata.setMultiRegion(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MultiRegionConfiguration")) {
            keyMetadata.setMultiRegionConfiguration(MultiRegionConfigurationJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("PendingDeletionWindowInDays")) {
            keyMetadata.setPendingDeletionWindowInDays(IntegerJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("MacAlgorithms")) {
            keyMetadata.setMacAlgorithms(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return keyMetadata;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 82 with AwsJsonReader

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

the class ListGrantsResultJsonUnmarshaller method unmarshall.

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

Example 83 with AwsJsonReader

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

the class MultiRegionKeyJsonUnmarshaller method unmarshall.

public MultiRegionKey unmarshall(JsonUnmarshallerContext context) throws Exception {
    AwsJsonReader reader = context.getReader();
    if (!reader.isContainer()) {
        reader.skipValue();
        return null;
    }
    MultiRegionKey multiRegionKey = new MultiRegionKey();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("Arn")) {
            multiRegionKey.setArn(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Region")) {
            multiRegionKey.setRegion(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return multiRegionKey;
}
Also used : AwsJsonReader(com.amazonaws.util.json.AwsJsonReader)

Example 84 with AwsJsonReader

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

the class ReEncryptResultJsonUnmarshaller method unmarshall.

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

Example 85 with AwsJsonReader

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

the class DescribeCustomKeyStoresResultJsonUnmarshaller method unmarshall.

public DescribeCustomKeyStoresResult unmarshall(JsonUnmarshallerContext context) throws Exception {
    DescribeCustomKeyStoresResult describeCustomKeyStoresResult = new DescribeCustomKeyStoresResult();
    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
        String name = reader.nextName();
        if (name.equals("CustomKeyStores")) {
            describeCustomKeyStoresResult.setCustomKeyStores(new ListUnmarshaller<CustomKeyStoresListEntry>(CustomKeyStoresListEntryJsonUnmarshaller.getInstance()).unmarshall(context));
        } else if (name.equals("NextMarker")) {
            describeCustomKeyStoresResult.setNextMarker(StringJsonUnmarshaller.getInstance().unmarshall(context));
        } else if (name.equals("Truncated")) {
            describeCustomKeyStoresResult.setTruncated(BooleanJsonUnmarshaller.getInstance().unmarshall(context));
        } else {
            reader.skipValue();
        }
    }
    reader.endObject();
    return describeCustomKeyStoresResult;
}
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