public Zone build() { return new Zone(super.id, super.creationTimestamp, super.selfLink, super.name, super.description, status, maintenanceWindows.build(), availableMachineTypes.build()); }
public Builder fromZone(Zone in) { return super.fromResource(in) .status(in.getStatus()) .maintenanceWindows(in.getMaintenanceWindows()) .availableMachineTypes(in.getAvailableMachineTypes()); } }
/** * {@inheritDoc} */ @Override public String toString() { return string().toString(); }
@Override public Location apply(Zone input) { return new LocationBuilder() .description(input.getDescription().orNull()) .metadata(ImmutableMap.of("selfLink", (Object) checkNotNull(input.getSelfLink(), "zone URI"))) .id(input.getName()) .scope(LocationScope.ZONE) .parent(GOOGLE_PROVIDER_LOCATION) .build(); } }
@Consumes(APPLICATION_JSON) public Zone expected(String baseUrl) { return Zone.create( // "13020128040171887099", // id parse("2012-10-19T16:42:54.131"), // creationTimestamp URI.create(baseUrl + "/party/zones/us-central1-a"), // selfLink "us-central1-a", // name "us-central1-a", // description Zone.Status.DOWN, // status ImmutableList.of( // maintenanceWindows Zone.MaintenanceWindow.create( // "2012-11-10-planned-outage", // name "maintenance zone", // description parse("2012-11-10T20:00:00.000"), // beginTime parse("2012-12-02T20:00:00.000") // endTime) )), // null, // deprecated "us-central1", // region null // availableMachineTypes ); } }
@Override public Location apply(Zone input) { return new LocationBuilder() .description(input.getDescription().orNull()) .metadata(ImmutableMap.of("selfLink", (Object) checkNotNull(input.getSelfLink(), "zone URI"))) .id(input.getName()) .scope(LocationScope.ZONE) .parent(GOOGLE_PROVIDER_LOCATION) .build(); } }
@Test(groups = "live", dependsOnMethods = "testListZone") public void testGetZone() { Zone zone = api().get(this.zone.name()); assertNotNull(zone); assertZoneEquals(zone, this.zone); }
@Consumes(APPLICATION_JSON) public ListPage<Zone> expected(String baseUrl) { Zone zone1 = new ParseZoneTest().expected(baseUrl); Zone zone2 = Zone.create( // "13024414164050619686", // id parse("2012-10-24T20:13:19.271"), // creationTimestamp URI.create(baseUrl + "/party/zones/us-central1-b"), // selfLink "us-central1-b", // name "us-central1-b", // description Zone.Status.UP, // status ImmutableList.of( // maintenanceWindows Zone.MaintenanceWindow.create( // "2013-02-17-planned-outage", // name "maintenance zone", // description parse("2013-02-17T08:00:00.000"), // beginTime parse("2013-03-03T08:00:00.000") // endTime) )), // null, // deprecated "us-central1", // region null // availableMachineTypes ); return ForwardingListPage.create( // ImmutableList.of(zone1, zone2), // items null // nextPageToken ); } }
public Builder fromZone(Zone in) { return super.fromResource(in) .status(in.getStatus()) .maintenanceWindows(in.getMaintenanceWindows()) .availableMachineTypes(in.getAvailableMachineTypes()); } }
/** * {@inheritDoc} */ @Override public String toString() { return string().toString(); }
public Zone build() { return new Zone(super.id, super.creationTimestamp, super.selfLink, super.name, super.description, status, maintenanceWindows.build(), availableMachineTypes.build()); }