use of com.amazonaws.services.s3.model.inventory.InventoryS3BucketDestination in project aws-sdk-android by aws-amplify.
the class BucketConfigurationXmlFactory method writeInventoryDestination.
private void writeInventoryDestination(XmlWriter xml, InventoryDestination destination) {
if (destination == null) {
return;
}
xml.start("Destination");
final InventoryS3BucketDestination s3BucketDestination = destination.getS3BucketDestination();
if (s3BucketDestination != null) {
xml.start("S3BucketDestination");
addParameterIfNotNull(xml, "AccountId", s3BucketDestination.getAccountId());
addParameterIfNotNull(xml, "Bucket", s3BucketDestination.getBucketArn());
addParameterIfNotNull(xml, "Prefix", s3BucketDestination.getPrefix());
addParameterIfNotNull(xml, "Format", s3BucketDestination.getFormat());
// </S3BucketDestination>
xml.end();
}
// </Destination>
xml.end();
}
use of com.amazonaws.services.s3.model.inventory.InventoryS3BucketDestination in project aws-sdk-android by aws-amplify.
the class BucketInventorySaxUnmarshallerTest method getResponse_unmarshalls_properly.
@Test
public void getResponse_unmarshalls_properly() throws Exception {
InventoryConfiguration configuration = parseGetBucketInventoryConfigurationResponse(GET_RESPONSE).getInventoryConfiguration();
assertEquals("inventory-id", configuration.getId());
InventoryS3BucketDestination s3BucketDestination = configuration.getDestination().getS3BucketDestination();
assertEquals(InventoryFormat.CSV.toString(), s3BucketDestination.getFormat());
assertEquals("accountId", s3BucketDestination.getAccountId());
assertEquals("arn:aws:s3:::bucket", s3BucketDestination.getBucketArn());
assertEquals("prefix", s3BucketDestination.getPrefix());
assertTrue(configuration.isEnabled());
assertEquals("prefix", ((InventoryPrefixPredicate) configuration.getInventoryFilter().getPredicate()).getPrefix());
assertEquals(InventoryIncludedObjectVersions.All.toString(), configuration.getIncludedObjectVersions());
List<String> optionalFields = configuration.getOptionalFields();
assertEquals(3, optionalFields.size());
assertTrue(optionalFields.containsAll(Arrays.asList(InventoryOptionalField.LastModifiedDate.toString(), InventoryOptionalField.StorageClass.toString(), InventoryOptionalField.ReplicationStatus.toString())));
assertFalse(optionalFields.contains(InventoryOptionalField.Size.toString()));
assertEquals(InventoryFrequency.Daily.toString(), configuration.getSchedule().getFrequency());
}
use of com.amazonaws.services.s3.model.inventory.InventoryS3BucketDestination in project aws-sdk-android by aws-amplify.
the class BucketInventorySaxUnmarshallerTest method listResponse_unmarshalls_properly.
@Test
public void listResponse_unmarshalls_properly() throws Exception {
ListBucketInventoryConfigurationsResult result = parseListBucketInventoryConfigurationsResponse(LIST_RESPONSE);
assertTrue(result.isTruncated());
assertEquals("token1", result.getContinuationToken());
assertEquals("token2", result.getNextContinuationToken());
List<InventoryConfiguration> inventoryConfigurationList = result.getInventoryConfigurationList();
assertEquals(2, inventoryConfigurationList.size());
InventoryConfiguration configuration = inventoryConfigurationList.get(0);
assertEquals("configId", configuration.getId());
InventoryS3BucketDestination s3BucketDestination = configuration.getDestination().getS3BucketDestination();
assertEquals(InventoryFormat.CSV.toString(), s3BucketDestination.getFormat());
assertEquals("accountId", s3BucketDestination.getAccountId());
assertEquals("arn:aws:s3:::bucket", s3BucketDestination.getBucketArn());
assertEquals("prefix", s3BucketDestination.getPrefix());
assertTrue(configuration.isEnabled());
assertEquals("prefix", ((InventoryPrefixPredicate) configuration.getInventoryFilter().getPredicate()).getPrefix());
assertEquals(InventoryIncludedObjectVersions.All.toString(), configuration.getIncludedObjectVersions());
List<String> optionalFields = configuration.getOptionalFields();
assertEquals(3, optionalFields.size());
assertTrue(optionalFields.containsAll(Arrays.asList(InventoryOptionalField.LastModifiedDate.toString(), InventoryOptionalField.StorageClass.toString(), InventoryOptionalField.ReplicationStatus.toString())));
assertFalse(optionalFields.contains(InventoryOptionalField.Size.toString()));
assertEquals(InventoryFrequency.Daily.toString(), configuration.getSchedule().getFrequency());
// Assert second Inventory configuration
configuration = inventoryConfigurationList.get(1);
assertEquals("configId2", configuration.getId());
assertNull(configuration.getInventoryFilter().getPredicate());
}
Aggregations