/** * <p> * The ID of the VPC the subnet is in. * </p> * * @param vpcId * The ID of the VPC the subnet is in. * @return Returns a reference to this object so that method calls can be chained together. */ public Subnet withVpcId(String vpcId) { setVpcId(vpcId); return this; }
subnet.setVpcId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
/** * <p> * The ID of the VPC the subnet is in. * </p> * * @param vpcId * The ID of the VPC the subnet is in. * @return Returns a reference to this object so that method calls can be chained together. */ public Subnet withVpcId(String vpcId) { setVpcId(vpcId); return this; }
subnet.setVpcId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Test public void testSerialization() throws JsonProcessingException { String account = "123456"; Regions region = Regions.US_WEST_1; SubnetScanner scanner = getProjector().createBuilder(AWSScannerBuilder.class).withAccountId(account).withRegion(region).build(SubnetScanner.class); Subnet subnet = new Subnet(); subnet.setAvailabilityZone("us-west-2a"); subnet.setCidrBlock("192.168.100.0/24"); subnet.setSubnetId("subnet-1234"); subnet.setVpcId("vpc-9876"); subnet.setTags(Lists.newArrayList(new Tag("fizz","buzz"),new Tag("foo","bar"))); JsonNode n = scanner.convertAwsObject(subnet, Region.getRegion(region)); prettyPrint(n); Assertions.assertThat(n.path("aws_vpcId").asText()).isEqualTo("vpc-9876"); Assertions.assertThat(n.path("aws_subnetId").asText()).isEqualTo("subnet-1234"); Assertions.assertThat(n.path("aws_region").asText()).isEqualTo(region.getName()); Assertions.assertThat(n.path("aws_account").asText()).isEqualTo(account); Assertions.assertThat(n.path("aws_arn").asText()).isEqualTo("arn:aws:ec2:us-west-1:123456:subnet/subnet-1234"); Assertions.assertThat(n.path("aws_tag_fizz").asText()).isEqualTo("buzz"); Assertions.assertThat(n.path("aws_cidrBlock").asText()).isEqualTo("192.168.100.0/24"); } }
subnet.setVpcId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;