use of com.google.api.services.compute.model.MachineType.ScratchDisks in project google-cloud-java by GoogleCloudPlatform.
the class MachineType method toPb.
com.google.api.services.compute.model.MachineType toPb() {
com.google.api.services.compute.model.MachineType machineTypePb = new com.google.api.services.compute.model.MachineType();
if (generatedId != null) {
machineTypePb.setId(new BigInteger(generatedId));
}
if (creationTimestamp != null) {
machineTypePb.setCreationTimestamp(TIMESTAMP_FORMATTER.print(creationTimestamp));
}
machineTypePb.setName(machineTypeId.getType());
machineTypePb.setDescription(description);
machineTypePb.setSelfLink(machineTypeId.getSelfLink());
machineTypePb.setGuestCpus(cpus);
machineTypePb.setMemoryMb(memoryMb);
if (scratchDisksSizeGb != null) {
machineTypePb.setScratchDisks(Lists.transform(scratchDisksSizeGb, new Function<Integer, ScratchDisks>() {
@Override
public ScratchDisks apply(Integer diskSize) {
return new ScratchDisks().setDiskGb(diskSize);
}
}));
}
machineTypePb.setMaximumPersistentDisks(maximumPersistentDisks);
machineTypePb.setMaximumPersistentDisksSizeGb(maximumPersistentDisksSizeGb);
machineTypePb.setZone(machineTypeId.getZoneId().getZone());
if (deprecationStatus != null) {
machineTypePb.setDeprecated(deprecationStatus.toPb());
}
return machineTypePb;
}
Aggregations