You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/11/04 00:21:33 UTC

[12/14] JCLOUDS-750 Convert GoogleComputeEngine to AutoValue + general cleanup.

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
index 26997e5..1af5d6b 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Deprecated.java
@@ -16,177 +16,42 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Optional.fromNullable;
-
-import java.beans.ConstructorProperties;
 import java.net.URI;
 
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
-
-/**
- * Deprecation information for an image or kernel
- */
-public class Deprecated {
-   private final Optional<String> state;
-   private final Optional<URI> replacement;
-   private final Optional<String> deprecated;
-   private final Optional<String> obsolete;
-   private final Optional<String> deleted;
-
-   @ConstructorProperties({"state", "replacement", "deprecated", "obsolete", "deleted"})
-   public Deprecated(String state, URI replacement, String deprecated, String obsolete,
-                     String deleted) {
-      this.state = fromNullable(state);
-      this.replacement = fromNullable(replacement);
-      this.deprecated = fromNullable(deprecated);
-      this.obsolete = fromNullable(obsolete);
-      this.deleted = fromNullable(deleted);
-   }
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-   /**
-    * @return The deprecation state of this image.
-    */
-   public Optional<String> getState() {
-      return state;
-   }
+import com.google.auto.value.AutoValue;
 
-   /**
-    * @return A fully-qualified URL of the suggested replacement for the deprecated image.
-    */
-   public Optional<URI> getReplacement() {
-      return replacement;
-   }
-
-   /**
-    * @return An optional RFC3339 timestamp for when the deprecation state of this resource will be changed to DEPRECATED.
-    */
-   public Optional<String> getDeprecated() {
-      return deprecated;
-   }
-
-   /**
-    * @return An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed toOBSOLETE.
-    */
-   public Optional<String> getObsolete() {
-      return obsolete;
-   }
+/** Deprecation information for an image or kernel */
+@AutoValue
+public abstract class Deprecated {
+   /** The deprecation state of this image. */
+   @Nullable public abstract String state();
 
-   /**
-    * @return An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to DELETED.
-    */
-   public Optional<String> getDeleted() {
-      return deleted;
-   }
+   /** A fully-qualified URL of the suggested replacement for the deprecated image. */
+   @Nullable public abstract URI replacement();
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public int hashCode() {
-      return Objects.hashCode(state, replacement, deprecated, obsolete, deleted);
-   }
+   /** An optional RFC3339 timestamp for when the deprecation state of this resource will be changed to DEPRECATED. */
+   @Nullable public abstract String deprecated();
 
    /**
-    * {@inheritDoc}
+    * An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to
+    * OBSOLETE.
     */
-   @Override
-   public boolean equals(Object obj) {
-      if (this == obj) return true;
-      if (obj == null || getClass() != obj.getClass()) return false;
-      Deprecated that = Deprecated.class.cast(obj);
-      return equal(this.state, that.state)
-              && equal(this.replacement, that.replacement)
-              && equal(this.deprecated, that.deprecated)
-              && equal(this.obsolete, that.obsolete)
-              && equal(this.deleted, that.deleted);
-   }
-
-   protected Objects.ToStringHelper string() {
-      return toStringHelper(this)
-              .omitNullValues()
-              .add("state", state.orNull())
-              .add("replacement", replacement.orNull())
-              .add("deprecated", deprecated.orNull())
-              .add("obsolete", obsolete.orNull())
-              .add("deleted", deleted.orNull());
-   }
+   @Nullable public abstract String obsolete();
 
    /**
-    * {@inheritDoc}
+    * An optional RFC3339 timestamp on or after which the deprecation state of this resource will be changed to
+    * DELETED.
     */
-   @Override
-   public String toString() {
-      return string().toString();
-   }
+   @Nullable public abstract String deleted();
 
-   public static Builder builder() {
-      return new Builder();
+   @SerializedNames({ "state", "replacement", "deprecated", "obsolete", "deleted" })
+   public static Deprecated create(String state, URI replacement, String deprecated, String obsolete, String deleted) {
+      return new AutoValue_Deprecated(state, replacement, deprecated, obsolete, deleted);
    }
 
-   public Builder toBuilder() {
-      return builder().fromDeprecated(this);
-   }
-
-   public static class Builder {
-      private String state;
-      private URI replacement;
-      private String deprecated;
-      private String obsolete;
-      private String deleted;
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.Deprecated#getState()
-       */
-      public Builder state(String state) {
-         this.state = state;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.Deprecated#getReplacement()
-       */
-      public Builder replacement(URI replacement) {
-         this.replacement = replacement;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.Deprecated#getDeprecated()
-       */
-      public Builder deprecated(String deprecated) {
-         this.deprecated = deprecated;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.Deprecated#getObsolete()
-       */
-      public Builder obsolete(String obsolete) {
-         this.obsolete = obsolete;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.Deprecated#getDeprecated()
-       */
-      public Builder deleted(String deleted) {
-         this.deleted = deleted;
-         return this;
-      }
-
-      public Deprecated build() {
-         return new Deprecated(state, replacement, deprecated, obsolete, deleted);
-      }
-
-      public Builder fromDeprecated(Deprecated in) {
-         return new Builder().state(in.getState().orNull())
-                 .replacement(in.getReplacement().orNull())
-                 .deprecated(in.getDeprecated().orNull())
-                 .obsolete(in.getObsolete().orNull())
-                 .deleted(in.getDeleted().orNull());
-      }
+   Deprecated() {
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
index 0494f43..140f47a 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java
@@ -16,130 +16,38 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Optional.fromNullable;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
 import java.net.URI;
-import java.util.Date;
 
 import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-import com.google.common.annotations.Beta;
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
+import com.google.auto.value.AutoValue;
 
-/**
- * A persistent disk resource
- */
-@Beta
-public final class Disk extends AbstractDisk {
+@AutoValue
+public abstract class Disk {
+   public abstract String id();
 
-   private final URI zone;
-   private final Optional<URI> type;
+   public abstract URI zone();
 
-   @ConstructorProperties({
-           "id", "creationTimestamp", "selfLink", "name", "description", "sizeGb", "zone",
-           "status", "type"
-   })
-   private Disk(String id, Date creationTimestamp, URI selfLink, String name, String description,
-                Integer sizeGb, URI zone, String status, @Nullable URI type) {
-      super(Kind.DISK, id, creationTimestamp, selfLink, name, description, sizeGb, status);
-      this.zone = checkNotNull(zone, "zone of %s", name);
-      this.type = fromNullable(type);
-   }
+   public abstract String status(); // TODO: enum
 
-   /**
-    * @return URL for the zone where the persistent disk resides.
-    */
-   public URI getZone() {
-      return zone;
-   }
+   public abstract String name();
 
-   /**
-    * @return URL of the disk type resource describing which disk type
-    */
-   public Optional<URI> getType(){
-      return type;
-   }
+   @Nullable public abstract String description();
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public boolean equals(Object obj) {
-      if (this == obj) return true;
-      if (obj == null || getClass() != obj.getClass()) return false;
-      Disk that = Disk.class.cast(obj);
-      return equal(this.kind, that.kind)
-              && equal(this.name, that.name)
-              && equal(this.zone, that.zone);
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   protected Objects.ToStringHelper string() {
-      return super.string()
-              .omitNullValues()
-              .add("zone", zone);
-   }
+   public abstract int sizeGb();
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public String toString() {
-      return string().toString();
-   }
+   public abstract URI selfLink();
 
-   public static Builder builder() {
-      return new Builder();
-   }
+   /** URL of the corresponding disk type resource. */
+   @Nullable public abstract URI type();
 
-   public Builder toBuilder() {
-      return new Builder().fromDisk(this);
+   @SerializedNames({ "id", "zone", "status", "name", "description", "sizeGb", "selfLink", "type" })
+   public static Disk create(String id, URI zone, String status, String name, String description, int sizeGb,
+         URI selfLink, URI type) {
+      return new AutoValue_Disk(id, zone, status, name, description, sizeGb, selfLink, type);
    }
 
-   public static final class Builder extends AbstractDisk.Builder<Builder> {
-
-      private URI zone;
-      private URI type;
-
-      /**
-       * @see Disk#getZone()
-       */
-      public Builder zone(URI zone) {
-         this.zone = zone;
-         return this;
-      }
-
-      /**
-       * @see Disk#getType()
-       */
-      public Builder type(URI type){
-         this.type = type;
-         return this;
-      }
-
-      @Override
-      protected Builder self() {
-         return this;
-      }
-
-      public Disk build() {
-         return new Disk(super.id, super.creationTimestamp, super.selfLink, super.name,
-                 super.description, super.sizeGb, zone, super.status, type);
-      }
-
-      public Builder fromDisk(Disk in) {
-         return super.fromAbstractDisk(in)
-                 .zone(in.getZone())
-                 .type(in.getType().orNull());
-      }
-
+   Disk(){
    }
-
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
index ac7224c..bab2d08 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/DiskType.java
@@ -16,150 +16,38 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import static com.google.common.base.Optional.fromNullable;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
 import java.net.URI;
-import java.util.Date;
 
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-/**
- * Represents a DiskType resource.
- *
- * @see <a href="https://cloud.google.com/compute/docs/reference/latest/diskTypes"/>
- */
-public final class DiskType extends Resource {
+import com.google.auto.value.AutoValue;
 
-   private final String zone;
-   private final Long defaultDiskSizeGb;
-   private final Optional<String> validDiskSize;
-   private final Optional<Deprecated> deprecated;
-
-   @ConstructorProperties({
-      "id", "creationTimestamp", "selfLink", "name", "description", "validDiskSize",
-      "deprecated", "zone", "defaultDiskSizeGb"
-   })
-   private DiskType(String id, Date creationTimestamp, URI selfLink, String name, String description,
-                  String validDiskSize, Deprecated deprecated, String zone,  long defaultDiskSizeGb){
-      super(Kind.DISK_TYPE, id == null ? "" : id, creationTimestamp, selfLink, name, description);
-      this.validDiskSize = fromNullable(validDiskSize);
-      this.deprecated = fromNullable(deprecated);
-      this.zone = checkNotNull(zone, "zone of %s", name);
-      this.defaultDiskSizeGb = defaultDiskSizeGb;
-   }
+@AutoValue
+public abstract class DiskType {
 
-   /**
-    * @return An optional textual description of the valid disk size. For example, "10GB-10TB."
-    */
-   public Optional<String> getValidDiskSize(){
-      return validDiskSize;
-   }
+   public abstract String name();
 
-   /**
-    * @return If applicable, the deprecation status associated with this disk type.
-    */
-   public Optional<Deprecated> getDeprecated(){
-      return deprecated;
-   }
+   @Nullable public abstract String description();
 
-   /**
-    * @return The fully-qualified URL for the zone where the disk type resource resides.
-    */
-   public String getZone(){
-      return zone;
-   }
+   /** Textual description of the valid disk size. For example, "10GB-10TB." */
+   @Nullable public abstract String validDiskSize();
 
-   /**
-    * @return Server defined default disk size in GB.
-    */
-   public long getDefaultDiskSizeGb(){
-      return defaultDiskSizeGb;
-   }
+   @Nullable public abstract Deprecated deprecated();
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   protected Objects.ToStringHelper string() {
-      return super.string()
-              .add("validDiskSize", validDiskSize.orNull())
-              .add("defaultDiskSizeGb", defaultDiskSizeGb)
-              .add("zone", zone)
-              .add("deprecated", deprecated.orNull());
-   }
+   public abstract URI zone();
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public String toString() {
-      return string().toString();
-   }
+   public abstract URI selfLink();
 
-   public static Builder builder() {
-      return new Builder();
-   }
+   /** Server defined default disk size in GB. */
+   public abstract long defaultDiskSizeGb();
 
-   public Builder toBuilder(){
-      return new Builder().fromDiskType(this);
+   @SerializedNames({ "name", "description", "validDiskSize", "deprecated", "zone", "selfLink", "defaultDiskSizeGb" })
+   public static DiskType create(String name, String description, String validDiskSize, Deprecated deprecated, URI zone,
+         URI selfLink, long defaultDiskSizeGb) {
+      return new AutoValue_DiskType(name, description, validDiskSize, deprecated, zone, selfLink, defaultDiskSizeGb);
    }
 
-   public static final class Builder extends Resource.Builder<Builder> {
-
-      private String zone;
-      private Long defaultDiskSizeGb;
-      private String validDiskSize;
-      private Deprecated deprecated;
-
-      /**
-       * @see DiskType#getZone()
-       */
-      public Builder zone(String zone){
-         this.zone = zone;
-         return this;
-      }
-
-      /**
-       * @see DiskType#getDefaultDiskSizeGb()
-       */
-      public Builder defaultDiskSizeGb(long defaultDiskSizeGb){
-         this.defaultDiskSizeGb = defaultDiskSizeGb;
-         return this;
-      }
-
-      /**
-       * @see DiskType#getValidDiskSize()
-       */
-      public Builder validDiskSize(String validDiskSize){
-         this.validDiskSize = validDiskSize;
-         return this;
-      }
-
-      /**
-       * @see DiskType#getDeprecated()
-       */
-      public Builder deprecated(Deprecated deprecated){
-         this.deprecated = deprecated;
-         return this;
-      }
-
-      @Override
-      protected Builder self() {
-         return this;
-      }
-
-      public DiskType build() {
-         return new DiskType(id, creationTimestamp, selfLink, name, description,
-               validDiskSize, deprecated, zone, defaultDiskSizeGb);
-      }
-
-      public Builder fromDiskType(DiskType in) {
-         return super.fromResource(in).zone(in.getZone()).defaultDiskSizeGb(in
-                 .getDefaultDiskSizeGb()).validDiskSize(in.getValidDiskSize().orNull())
-                 .deprecated(in.getDeprecated().orNull());
-      }
+   DiskType() {
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
index 6197ff7..e8e4add 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java
@@ -16,59 +16,53 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Range.closed;
-import static com.google.common.collect.Range.singleton;
+import static org.jclouds.googlecomputeengine.internal.NullSafeCopies.copyOf;
 
-import java.beans.ConstructorProperties;
 import java.net.URI;
-import java.util.Date;
-import java.util.Set;
+import java.util.List;
 
-import org.jclouds.net.domain.IpProtocol;
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-import com.google.common.annotations.Beta;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.RangeSet;
-import com.google.common.collect.TreeRangeSet;
+import com.google.auto.value.AutoValue;
 
-/**
- * Represents a network firewall
- */
-@Beta
-public final class Firewall extends Resource {
+@AutoValue
+public abstract class Firewall {
+
+   /** A protocol and port-range tuple that describes a permitted connection. */
+   @AutoValue
+   public abstract static class Rule {
+      /** This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number. */
+      public abstract String ipProtocol();
+
+      /**
+       * An optional list of ports which are allowed. This is only applicable for UDP or TCP protocol. Each entry must
+       * be either an integer or a range (ex. {@code 12345-12349}). If not specified, connections through any port are
+       * allowed.
+       */
+      @Nullable public abstract List<String> ports();
 
-   private final URI network;
-   private final Set<String> sourceRanges;
-   private final Set<String> sourceTags;
-   private final Set<String> targetTags;
-   private final Set<Rule> allowed;
+      @SerializedNames({ "IPProtocol", "ports" })
+      public static Rule create(String ipProtocol, List<String> ports) {
+         return new AutoValue_Firewall_Rule(ipProtocol, ports);
+      }
 
-   @ConstructorProperties({
-           "id", "creationTimestamp", "selfLink", "name", "description", "network", "sourceRanges",
-           "sourceTags", "targetTags", "allowed"
-   })
-   protected Firewall(String id, Date creationTimestamp, URI selfLink, String name, String description,
-                      URI network, Set<String> sourceRanges, Set<String> sourceTags, Set<String> targetTags,
-                      Set<Rule> allowed) {
-      super(Kind.FIREWALL, id, creationTimestamp, selfLink, name, description);
-      this.network = checkNotNull(network, "network of %s", name);
-      this.sourceRanges = sourceRanges == null ? ImmutableSet.<String>of() : sourceRanges;
-      this.sourceTags = sourceTags == null ? ImmutableSet.<String>of() : sourceTags;
-      this.targetTags = targetTags == null ? ImmutableSet.<String>of() : targetTags;
-      this.allowed = allowed == null ? ImmutableSet.<Rule>of() : allowed;
+      Rule() {
+      }
    }
 
+   public abstract String id();
+
+   public abstract URI selfLink();
+
+   public abstract String name();
+
+   @Nullable public abstract String description();
+
    /**
     * @return URI of the network to which this firewall is applied; provided by the client when the firewall is created.
     */
-   public URI getNetwork() {
-      return network;
-   }
+   public abstract URI network();
 
    /**
     * One or both of sourceRanges and sourceTags may be set; an inbound connection is allowed if either the range or
@@ -76,299 +70,37 @@ public final class Firewall extends Resource {
     *
     * @return a list of IP address blocks expressed in CIDR format which this rule applies to.
     */
-   public Set<String> getSourceRanges() {
-      return sourceRanges;
-   }
+   public abstract List<String> sourceRanges();
 
    /**
     * @return a list of instance items which this rule applies to. One or both of sourceRanges and sourceTags may be
-    *         set; an inbound connection is allowed if either the range or the tag of the source matches.
+    * set; an inbound connection is allowed if either the range or the tag of the source matches.
     */
-   public Set<String> getSourceTags() {
-      return sourceTags;
-   }
+   public abstract List<String> sourceTags();
 
    /**
     * If no targetTags are specified, the firewall rule applies to all instances on the specified network.
     *
     * @return a list of instance items indicating sets of instances located on network which may make network
-    *         connections as specified in allowed.
+    * connections as specified in allowed.
     */
-   public Set<String> getTargetTags() {
-      return targetTags;
-   }
+   public abstract List<String> targetTags();
 
    /**
     * Each rule specifies a protocol and port-range tuple that describes a permitted connection.
     *
     * @return the list of rules specified by this firewall.
     */
-   public Set<Rule> getAllowed() {
-      return allowed;
+   public abstract List<Rule> allowed();
+
+   @SerializedNames(
+         { "id", "selfLink", "name", "description", "network", "sourceRanges", "sourceTags", "targetTags", "allowed" })
+   public static Firewall create(String id, URI selfLink, String name, String description, URI network,
+         List<String> sourceRanges, List<String> sourceTags, List<String> targetTags, List<Rule> allowed) {
+      return new AutoValue_Firewall(id, selfLink, name, description, network, copyOf(sourceRanges), copyOf(sourceTags),
+            copyOf(targetTags), copyOf(allowed));
    }
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   protected Objects.ToStringHelper string() {
-      return super.string()
-              .add("network", network)
-              .add("sourceRanges", sourceRanges)
-              .add("sourceTags", sourceTags)
-              .add("targetTags", targetTags)
-              .add("allowed", allowed);
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public String toString() {
-      return string().toString();
-   }
-
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   public Builder toBuilder() {
-      return new Builder().fromFirewall(this);
-   }
-
-   public static final class Builder extends Resource.Builder<Builder> {
-
-      private URI network;
-      private ImmutableSet.Builder<String> sourceRanges = ImmutableSet.builder();
-      private ImmutableSet.Builder<String> sourceTags = ImmutableSet.builder();
-      private ImmutableSet.Builder<String> targetTags = ImmutableSet.builder();
-      private ImmutableSet.Builder<Rule> allowed = ImmutableSet.builder();
-
-      /**
-       * @see Firewall#getNetwork()
-       */
-      public Builder network(URI network) {
-         this.network = network;
-         return this;
-      }
-
-      /**
-       * @see Firewall#getSourceRanges()
-       */
-      public Builder addSourceRange(String sourceRange) {
-         this.sourceRanges.add(checkNotNull(sourceRange));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getSourceRanges()
-       */
-      public Builder sourceRanges(Set<String> sourceRanges) {
-         this.sourceRanges.addAll(checkNotNull(sourceRanges));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getSourceTags()
-       */
-      public Builder addSourceTag(String sourceTag) {
-         this.sourceTags.add(checkNotNull(sourceTag));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getSourceTags()
-       */
-      public Builder sourceTags(Set<String> sourceTags) {
-         this.sourceTags.addAll(checkNotNull(sourceTags));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getTargetTags()
-       */
-      public Builder addTargetTag(String targetTag) {
-         this.targetTags.add(checkNotNull(targetTag));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getTargetTags()
-       */
-      public Builder targetTags(Set<String> targetTags) {
-         this.targetTags.addAll(checkNotNull(targetTags));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getAllowed()
-       */
-      public Builder addAllowed(Rule firewallRule) {
-         this.allowed.add(checkNotNull(firewallRule));
-         return this;
-      }
-
-      /**
-       * @see Firewall#getAllowed()
-       */
-      public Builder allowed(Set<Rule> firewallRules) {
-         this.allowed = ImmutableSet.builder();
-         this.allowed.addAll(firewallRules);
-         return this;
-      }
-
-      @Override
-      protected Builder self() {
-         return this;
-      }
-
-      public Firewall build() {
-         return new Firewall(super.id, super.creationTimestamp, super.selfLink, super.name,
-                 super.description, network, sourceRanges.build(), sourceTags.build(), targetTags.build(),
-                 allowed.build());
-      }
-
-      public Builder fromFirewall(Firewall in) {
-         return super.fromResource(in).network(in.getNetwork()).sourceRanges(in.getSourceRanges()).sourceTags(in
-                 .getSourceTags()).targetTags(in.getTargetTags()).allowed(in.getAllowed());
-      }
-
-   }
-
-   /**
-    * A Firewall rule. Rule specifies a protocol and port-range tuple that describes a
-    * permitted connection.
-    *
-    * @see <a href="https://developers.google.com/compute/docs/reference/v1/firewalls"/>
-    */
-   public static final class Rule {
-
-      private final IpProtocol ipProtocol;
-      private final RangeSet<Integer> ports;
-
-      /* Some handy shortcuts */
-      public static Rule permitTcpRule(Integer start, Integer end) { return Rule.builder().IpProtocol(IpProtocol.TCP).addPortRange(start, end).build(); }
-      public static Rule permitTcpRule(Integer port) { return Rule.builder().IpProtocol(IpProtocol.TCP).addPort(port).build(); }
-      public static Rule permitUdpRule(Integer start, Integer end) { return Rule.builder().IpProtocol(IpProtocol.UDP).addPortRange(start, end).build(); }
-      public static Rule permitUdpRule(Integer port) { return Rule.builder().IpProtocol(IpProtocol.UDP).addPort(port).build(); }
-      @ConstructorProperties({
-              "IpProtocol", "ports"
-      })
-      private Rule(IpProtocol IpProtocol, RangeSet<Integer> ports) {
-         this.ipProtocol = checkNotNull(IpProtocol);
-         this.ports = ports == null ? TreeRangeSet.<Integer>create() : ports;
-      }
-
-      /**
-       * This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number.
-       *
-       * @return this is the IP protocol that is allowed for this rule.
-       */
-      public IpProtocol getIpProtocol() {
-         return ipProtocol;
-      }
-
-      /**
-       * Each entry must be either an integer or a range. If not specified, connections through any port are allowed.
-       * Example inputs include: ["22"], ["80,"443"], and ["12345-12349"].
-       * <p/>
-       * It is an error to specify this for any protocol that isn't UDP or TCP.
-       *
-       * @return An optional list of ports which are allowed.
-       */
-      public RangeSet<Integer> getPorts() {
-         return ports;
-      }
-
-      /**
-       * {@inheritDoc}
-       */
-      @Override
-      public int hashCode() {
-         return Objects.hashCode(ipProtocol, ports);
-      }
-
-      /**
-       * {@inheritDoc}
-       */
-      @Override
-      public boolean equals(Object obj) {
-         if (this == obj) return true;
-         if (obj == null || getClass() != obj.getClass()) return false;
-         Rule that = Rule.class.cast(obj);
-         return equal(this.ipProtocol, that.ipProtocol)
-                 && equal(this.ports, that.ports);
-      }
-
-      public Objects.ToStringHelper string() {
-         return toStringHelper(this)
-                 .add("IpProtocol", ipProtocol).add("ports", ports);
-      }
-
-      /**
-       * {@inheritDoc}
-       */
-      @Override
-      public String toString() {
-         return string().toString();
-      }
-
-      public static Builder builder() {
-         return new Builder();
-      }
-
-      public Builder toBuilder() {
-         return builder().fromFirewallRule(this);
-      }
-
-      public static final class Builder {
-
-         private IpProtocol ipProtocol;
-         private RangeSet<Integer> ports = TreeRangeSet.create();
-
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Firewall.Rule#getIpProtocol()
-          */
-         public Builder IpProtocol(IpProtocol IpProtocol) {
-            this.ipProtocol = IpProtocol;
-            return this;
-         }
-
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Firewall.Rule#getPorts()
-          */
-         public Builder addPort(Integer port) {
-            this.ports.add(singleton(checkNotNull(port, "port")));
-            return this;
-         }
-
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Firewall.Rule#getPorts()
-          */
-         public Builder addPortRange(Integer start, Integer end) {
-            checkState(checkNotNull(start, "start") < checkNotNull(end, "end"),
-                    "start of range must be lower than end of range");
-            this.ports.add(closed(start, end));
-            return this;
-         }
-
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Firewall.Rule#getPorts()
-          */
-         public Builder ports(RangeSet<Integer> ports) {
-            this.ports = TreeRangeSet.create();
-            this.ports.addAll(ports);
-            return this;
-         }
-
-         public Rule build() {
-            return new Rule(ipProtocol, ports);
-         }
-
-         public Builder fromFirewallRule(Rule firewallRule) {
-            return new Builder().IpProtocol(firewallRule.getIpProtocol()).ports(firewallRule.getPorts());
-         }
-      }
-
+   Firewall() {
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
index fd59a95..7216da9 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/ForwardingRule.java
@@ -16,199 +16,68 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import com.google.common.annotations.Beta;
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
-
-import java.beans.ConstructorProperties;
 import java.net.URI;
-import java.util.Date;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Optional.fromNullable;
-import static com.google.common.base.Preconditions.checkNotNull;
 
 import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-@Beta
-public class ForwardingRule extends Resource {
+import com.google.auto.value.AutoValue;
 
+@AutoValue
+public abstract class ForwardingRule {
 
-   /**
-    * "AH": Specifies the IP Authentication Header protocol.
-    * "ESP": Specifies the IP Encapsulating Security Payload protocol.
-    * "SCTP": Specifies the Stream Control Transmission Protocol.
-    * "TCP": Specifies the Transmission Control Protocol.
-    * "UDP": Specifies the User Datagram Protocol.
-    */
-   public enum IPProtocolOption {
+   public enum IPProtocol {
+      /** IP Authentication Header protocol. */
       AH,
+      /** IP Encapsulating Security Payload protocol. */
       ESP,
+      /** Stream Control Transmission Protocol. */
       SCTP,
+      /** Transmission Control Protocol. */
       TCP,
+      /** Specifies the User Datagram Protocol. */
       UDP
    }
 
-   private final URI region;
-   private final Optional<String> ipAddress;
-   private final Optional<IPProtocolOption> ipProtocol;
-   private final Optional<String> portRange;
-   private final URI target;
-
-   @ConstructorProperties({
-           "id", "creationTimestamp", "selfLink", "name", "description", "region", "IPAddress", "IPProtocol",
-           "portRange", "target"
-   })
-   private ForwardingRule(String id, Date creationTimestamp, URI selfLink, String name, String description,
-                      URI region, @Nullable String ipAddress, @Nullable IPProtocolOption ipProtocol, @Nullable String portRange,
-                      URI target) {
-      super(Kind.FORWARDING_RULE, id, creationTimestamp, selfLink, name, description);
-      this.region = checkNotNull(region, "region of %s", name);
-      this.ipAddress = fromNullable(ipAddress);
-      this.ipProtocol = fromNullable(ipProtocol);
-      this.portRange = fromNullable(portRange);
-      this.target = checkNotNull(target, "target of %s", name);
-   }
+   public abstract String id();
 
-   public static Builder builder() {
-      return new Builder();
-   }
+   public abstract URI selfLink();
 
-   /**
-    * @return URL of the region where the forwarding rule resides.
-    */
-   public URI getRegion() {
-      return region;
-   }
+   public abstract String name();
+
+   @Nullable public abstract String description();
+
+   public abstract URI region();
 
    /**
-    * @return the external IP address that this forwarding rule is serving on behalf of. If this is a reserved
+    * The external IP address that this forwarding rule is serving on behalf of. If this is a reserved
     * address, the address must live in the same region as the forwarding rule. By default,
     * this field is empty and  an ephemeral IP is assigned to the ForwardingRule.
     */
-   public Optional<String> getIpAddress() {
-      return ipAddress;
-   }
+   @Nullable public abstract String ipAddress();
 
-   /**
-    * @return the IP protocol to which this rule applies. If left empty, the default value used is TCP.
-    */
-   public Optional<IPProtocolOption> getIpProtocol() {
-      return ipProtocol;
-   }
+   public abstract IPProtocol ipProtocol();
 
    /**
-    * @return If IPProtocol is TCP or UDP, packets addressed to ports in the specified range will be forwarded to
+    * If IPProtocol is TCP or UDP, packets addressed to ports in the specified range will be forwarded to
     * backend. By default, this is empty and all ports are allowed.
     */
-   public Optional<String> getPortRange() {
-      return portRange;
-   }
+   @Nullable public abstract String portRange();
 
    /**
-    * @return the URL of the target resource to receive the matched traffic. The target resource must live in the
+    * The URL of the target resource to receive the matched traffic. The target resource must live in the
     * same region as this forwarding rule.
     */
-   public URI getTarget() {
-      return target;
+   public abstract URI target();
+
+   @SerializedNames(
+         { "id", "selfLink", "name", "description", "region", "IPAddress", "IPProtocol", "portRange", "target" })
+   public static ForwardingRule create(String id, URI selfLink, String name, String description, URI region,
+         String ipAddress, IPProtocol ipProtocol, String portRange, URI target) {
+      return new AutoValue_ForwardingRule(id, selfLink, name, description, region, ipAddress,
+            ipProtocol == null ? IPProtocol.TCP : ipProtocol, portRange, target);
    }
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public boolean equals(Object obj) {
-      if (this == obj) return true;
-      if (obj == null || getClass() != obj.getClass()) return false;
-      ForwardingRule that = ForwardingRule.class.cast(obj);
-      return equal(this.kind, that.kind)
-              && equal(this.name, that.name)
-              && equal(this.region, that.region);
+   ForwardingRule() {
    }
-
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   protected Objects.ToStringHelper string() {
-      return super.string()
-              .omitNullValues()
-              .add("region", region)
-              .add("ipAddress", ipAddress.orNull())
-              .add("ipProtocol", ipProtocol.orNull())
-              .add("portRange", portRange.orNull())
-              .add("target", target);
-   }
-
-   public Builder toBuilder() {
-      return new Builder().fromForwardingRule(this);
-   }
-
-   public static final class Builder extends Resource.Builder<Builder> {
-      private URI region;
-      private String ipAddress;
-      private IPProtocolOption ipProtocol;
-      private String portRange;
-      private URI target;
-
-      /**
-       * @see ForwardingRule#getRegion()
-       */
-      public Builder region(URI region) {
-         this.region = region;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.ForwardingRule#getIpAddress()
-       */
-      public Builder ipAddress(String ipAddress) {
-         this.ipAddress = ipAddress;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.ForwardingRule#getIpProtocol()
-       */
-      public Builder ipProtocol(IPProtocolOption ipProtocol) {
-         this.ipProtocol = ipProtocol;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.ForwardingRule#getPortRange()
-       */
-      public Builder portRange(String portRange) {
-         this.portRange = portRange;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.ForwardingRule#getTarget()
-       */
-      public Builder target(URI target) {
-         this.target = target;
-         return this;
-      }
-
-      @Override
-      protected Builder self() {
-         return this;
-      }
-
-      public ForwardingRule build() {
-         return new ForwardingRule(super.id, super.creationTimestamp, super.selfLink, super.name, super.description,
-                 region, ipAddress, ipProtocol, portRange, target);
-      }
-
-      public Builder fromForwardingRule(ForwardingRule in) {
-         return super.fromResource(in)
-                 .region(in.getRegion())
-                 .ipAddress(in.getIpAddress().orNull())
-                 .ipProtocol(in.getIpProtocol().orNull())
-                 .portRange(in.getPortRange().orNull())
-                 .target(in.getTarget());
-      }
-   }
-
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
index 8e0096a..0d49756 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/HttpHealthCheck.java
@@ -16,220 +16,67 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import com.google.common.annotations.Beta;
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
-
-import java.beans.ConstructorProperties;
 import java.net.URI;
-import java.util.Date;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Optional.fromNullable;
 
 import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-@Beta
-public class HttpHealthCheck extends Resource {
-   private final Optional<String> host;
-   private final Optional<String> requestPath;
-   private final Optional<Integer> port;
-   private final Optional<Integer> checkIntervalSec;
-   private final Optional<Integer> timeoutSec;
-   private final Optional<Integer> unhealthyThreshold;
-   private final Optional<Integer> healthyThreshold;
-
-   @ConstructorProperties({
-           "id", "creationTimestamp", "selfLink", "name", "description", "host", "requestPath", "port",
-           "checkIntervalSec", "timeoutSec", "unhealthyThreshold", "healthyThreshold"
-   })
-   private HttpHealthCheck(String id, Date creationTimestamp, URI selfLink, String name, String description,
-                           @Nullable String host, @Nullable String requestPath, int port, int checkIntervalSec,
-                           int timeoutSec, int unhealthyThreshold, int healthyThreshold) {
-      super(Kind.HTTP_HEALTH_CHECK, id, creationTimestamp, selfLink, name, description);
-      this.host = fromNullable(host);
-      this.requestPath = fromNullable(requestPath);
-      this.port = fromNullable(port);
-      this.checkIntervalSec = fromNullable(checkIntervalSec);
-      this.timeoutSec = fromNullable(timeoutSec);
-      this.unhealthyThreshold = fromNullable(unhealthyThreshold);
-      this.healthyThreshold = fromNullable(healthyThreshold);
-   }
+import com.google.auto.value.AutoValue;
 
-   public static Builder builder() {
-      return new Builder();
-   }
+@AutoValue
+public abstract class HttpHealthCheck {
 
-   /**
-    * @return the value of the host header in the HTTP health check request. If left empty (default value),
-    * the public IP on behalf of which this health check is performed will be used.
-    */
-   public Optional<String> getHost() {
-      return host;
-   }
+   public abstract String id();
 
-   /**
-    * @return the request path of the HTTP health check request. The default value is /.
-    */
-   public Optional<String> getRequestPath() {
-      return requestPath;
-   }
+   public abstract URI selfLink();
 
-   /**
-    * @return the TCP port number for the HTTP health check request. The default value is 80.
-    */
-   public Optional<Integer> getPort() {
-      return port;
-   }
+   public abstract String name();
 
-   /**
-    * @return how often (in seconds) to send a health check. The default value is 5 seconds.
-    */
-   public Optional<Integer> getCheckIntervalSec() {
-      return checkIntervalSec;
-   }
+   @Nullable public abstract String description();
 
    /**
-    * @return how long (in seconds) to wait before claiming failure. The default value is 5 seconds.
+    * The value of the host header in the HTTP health check request. If left empty (default value),
+    * the public IP on behalf of which this health check is performed will be used.
     */
-   public Optional<Integer> getTimeoutSec() {
-      return timeoutSec;
-   }
+   @Nullable public abstract String host();
 
-   /**
-    * @return a so-far healthy VM will be marked unhealthy after this many consecutive failures.
-    * The default value is 2.
-    */
-   public Optional<Integer> getUnhealthyThreshold() {
-      return unhealthyThreshold;
-   }
+   public abstract String requestPath();
 
-   /**
-    * @return an unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2.
-    */
-   public Optional<Integer> getHealthyThreshold() {
-      return healthyThreshold;
-   }
+   /** The TCP port number for the HTTP health check request. */
+   public abstract int port();
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public boolean equals(Object obj) {
-      if (this == obj) return true;
-      if (obj == null || getClass() != obj.getClass()) return false;
-      HttpHealthCheck that = HttpHealthCheck.class.cast(obj);
-      return equal(this.kind, that.kind)
-              && equal(this.name, that.name)
-              && equal(this.host, that.host);
-   }
+   /** How often (in seconds) to send a health check. */
+   public abstract int checkIntervalSec();
+
+   /** How long (in seconds) to wait before claiming failure. */
+   public abstract int timeoutSec();
+
+   /** A so-far healthy VM will be marked unhealthy after this many consecutive failures. */
+   public abstract int unhealthyThreshold();
+
+   /** An unhealthy VM will be marked healthy after this many consecutive successes. */
+   public abstract int healthyThreshold();
 
    /**
-    * {@inheritDoc}
+    * @param requestPath Defaults to "/" when null.
+    * @param port Defaults to 80 when null.
+    * @param checkIntervalSec Defaults to 5 when null.
+    * @param timeoutSec Defaults to 5 when null.
+    * @param unhealthyThreshold Defaults to 2 when null.
+    * @param healthyThreshold Defaults to 2 when null.
     */
-   @Override
-   protected Objects.ToStringHelper string() {
-      return super.string()
-              .omitNullValues()
-              .add("host", host.orNull())
-              .add("requestPath", requestPath.orNull())
-              .add("port", port.orNull())
-              .add("checkIntervalSec", checkIntervalSec.orNull())
-              .add("timeoutSec", timeoutSec.orNull())
-              .add("unhealthyThreshold", unhealthyThreshold.orNull())
-              .add("healthyThreshold", healthyThreshold.orNull());
-   }
-
-   public Builder toBuilder() {
-      return new Builder().fromHttpHealthCheck(this);
+   @SerializedNames(
+         { "id", "selfLink", "name", "description", "host", "requestPath", "port", "checkIntervalSec", "timeoutSec",
+               "unhealthyThreshold", "healthyThreshold" })
+   public static HttpHealthCheck create(String id, URI selfLink, String name, String description, String host,
+         String requestPath, Integer port, Integer checkIntervalSec, Integer timeoutSec, Integer unhealthyThreshold,
+         Integer healthyThreshold) {
+      return new AutoValue_HttpHealthCheck(id, selfLink, name, description, host,
+            requestPath != null ? requestPath : "/", port != null ? port : 80,
+            checkIntervalSec != null ? checkIntervalSec : 5, timeoutSec != null ? timeoutSec : 5,
+            unhealthyThreshold != null ? unhealthyThreshold : 2, healthyThreshold != null ? healthyThreshold : 2);
    }
 
-   public static final class Builder extends Resource.Builder<Builder> {
-      private String host;
-      private String requestPath;
-      private int port;
-      private int checkIntervalSec;
-      private int timeoutSec;
-      private int unhealthyThreshold;
-      private int healthyThreshold;
-
-      /**
-       * @see HttpHealthCheck#getHost()
-       */
-      public Builder host(String host) {
-         this.host = host;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.HttpHealthCheck#getRequestPath()
-       */
-      public Builder requestPath(String requestPath) {
-         this.requestPath = requestPath;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.HttpHealthCheck#getPort()
-       */
-      public Builder port(int port) {
-         this.port = port;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.HttpHealthCheck#getCheckIntervalSec()
-       */
-      public Builder checkIntervalSec(int checkIntervalSec) {
-         this.checkIntervalSec = checkIntervalSec;
-         return this;
-      }
-
-      /**
-       * @see org.jclouds.googlecomputeengine.domain.HttpHealthCheck#getTimeoutSec()
-       */
-      public Builder timeoutSec(int timeoutSec) {
-         this.timeoutSec = timeoutSec;
-         return this;
-      }
-
-      /**
-       * @see HttpHealthCheck#getUnhealthyThreshold()
-       */
-      public Builder unhealthyThreshold(int unhealthyThreshold) {
-         this.unhealthyThreshold = unhealthyThreshold;
-         return this;
-      }
-
-      /**
-       * @see HttpHealthCheck#getHealthyThreshold()
-       */
-      public Builder healthyThreshold(int healthyThreshold) {
-         this.healthyThreshold = healthyThreshold;
-         return this;
-      }
-
-      @Override
-      protected Builder self() {
-         return this;
-      }
-
-      public HttpHealthCheck build() {
-         return new HttpHealthCheck(super.id, super.creationTimestamp, super.selfLink, super.name,
-                 super.description, host, requestPath, port, checkIntervalSec, timeoutSec, unhealthyThreshold,
-                 healthyThreshold);
-      }
-
-      public Builder fromHttpHealthCheck(HttpHealthCheck in) {
-         return super.fromResource(in)
-                 .host(in.getHost().orNull())
-                 .requestPath(in.getRequestPath().orNull())
-                 .port(in.getPort().orNull())
-                 .checkIntervalSec(in.getCheckIntervalSec().orNull())
-                 .timeoutSec(in.getTimeoutSec().orNull())
-                 .unhealthyThreshold(in.getUnhealthyThreshold().orNull())
-                 .healthyThreshold(in.getHealthyThreshold().orNull());
-      }
+   HttpHealthCheck() {
    }
-
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/b41b0d04/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
index ddd315a..e70e92e 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java
@@ -16,266 +16,66 @@
  */
 package org.jclouds.googlecomputeengine.domain;
 
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Objects.toStringHelper;
-import static com.google.common.base.Optional.fromNullable;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.beans.ConstructorProperties;
 import java.net.URI;
-import java.util.Date;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Objects;
-import com.google.common.base.Optional;
-
-/**
- * Represents a disk image to use on an instance.
- */
-@Beta
-public final class Image extends Resource {
-
-   private final String sourceType;
-   private final Optional<RawDisk> rawDisk;
-   private final Optional<Deprecated> deprecated;
-
-   @ConstructorProperties({
-           "id", "creationTimestamp", "selfLink", "name", "description", "sourceType",
-           "rawDisk", "deprecated"
-   })
-   protected Image(String id, Date creationTimestamp, URI selfLink, String name, String description,
-                   String sourceType, RawDisk rawDisk, Deprecated deprecated) {
-      super(Kind.IMAGE, id, creationTimestamp, selfLink, name, description);
-      this.sourceType = checkNotNull(sourceType, "sourceType of %s", name);
-      this.rawDisk = fromNullable(rawDisk);
-      this.deprecated = fromNullable(deprecated);
-   }
-
-   /**
-    * @return must be RAW; provided by the client when the disk image is created.
-    */
-   public String getSourceType() {
-      return sourceType;
-   }
-
-   /**
-    * @return the raw disk image parameters.
-    */
-   public Optional<RawDisk> getRawDisk() {
-      return rawDisk;
-   }
-
-   /**
-    * @return the deprecation information for this image
-    */
-   public Optional<Deprecated> getDeprecated() {
-      return deprecated;
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   protected Objects.ToStringHelper string() {
-      return super.string()
-              .omitNullValues()
-              .add("sourceType", sourceType)
-              .add("rawDisk", rawDisk)
-              .add("deprecated", deprecated.orNull());
-   }
 
-   /**
-    * {@inheritDoc}
-    */
-   @Override
-   public String toString() {
-      return string().toString();
-   }
-
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   public Builder toBuilder() {
-      return new Builder().fromImage(this);
-   }
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.json.SerializedNames;
 
-   public static final class Builder extends Resource.Builder<Builder> {
+import com.google.auto.value.AutoValue;
 
-      private String sourceType;
-      private RawDisk rawDisk;
-      private Deprecated deprecated;
+@AutoValue
+public abstract class Image {
 
+   @AutoValue
+   public abstract static class RawDisk {
       /**
-       * @see Image#getSourceType()
+       * The full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk
+       * image is created.
        */
-      public Builder sourceType(String sourceType) {
-         this.sourceType = checkNotNull(sourceType, "sourceType");
-         return this;
-      }
+      public abstract URI source();
 
       /**
-       * @see Image#getDeprecated()
+       * The format used to encode and transmit the block device.
        */
-      public Builder deprecated(Deprecated deprecated) {
-         this.deprecated = checkNotNull(deprecated, "deprecated");
-         return this;
-      }
+      public abstract String containerType();
 
       /**
-       * @see Image#getRawDisk()
+       * SHA1 checksum of the disk image before unpacking; provided by the client when the disk
+       * image is created.
        */
-      public Builder rawDisk(RawDisk rawDisk) {
-         this.rawDisk = checkNotNull(rawDisk);
-         return this;
-      }
+      @Nullable public abstract String sha1Checksum();
 
-      @Override
-      protected Builder self() {
-         return this;
+      @SerializedNames({ "source", "containerType", "sha1Checksum" })
+      public static RawDisk create(URI source, String containerType, String sha1Checksum) {
+         return new AutoValue_Image_RawDisk(source, containerType, sha1Checksum);
       }
 
-      public Image build() {
-         return new Image(super.id, super.creationTimestamp, super.selfLink, super.name,
-                 super.description, sourceType, rawDisk, deprecated);
+      RawDisk() {
       }
-
-      public Builder fromImage(Image in) {
-         return super.fromResource(in)
-                 .sourceType(in.getSourceType())
-                 .rawDisk(in.getRawDisk().orNull())
-                 .deprecated(in.getDeprecated().orNull());
-      }
-
    }
 
-   /**
-    * A raw disk image, usually the base for an image.
-    *
-    * @see <a href="https://developers.google.com/compute/docs/reference/v1/images"/>
-    */
-   public static class RawDisk {
-
-      private final String source;
-      private final String containerType;
-      private final Optional<String> sha1Checksum;
-
-      @ConstructorProperties({
-              "source", "containerType", "sha1Checksum"
-      })
-      private RawDisk(String source, String containerType, String sha1Checksum) {
-         this.source = checkNotNull(source, "source");
-         this.containerType = checkNotNull(containerType, "containerType");
-         this.sha1Checksum = fromNullable(sha1Checksum);
-      }
-
-      /**
-       * @return the full Google Cloud Storage URL where the disk image is stored; provided by the client when the disk
-       *         image is created.
-       */
-      public String getSource() {
-         return source;
-      }
-
-      /**
-       * @return the format used to encode and transmit the block device.
-       */
-      public String getContainerType() {
-         return containerType;
-      }
-
-      /**
-       * @return an optional SHA1 checksum of the disk image before unpacking; provided by the client when the disk
-       *         image is created.
-       */
-      public Optional<String> getSha1Checksum() {
-         return sha1Checksum;
-      }
-
-      /**
-       * {@inheritDoc}
-       */
-      @Override
-      public int hashCode() {
-         return Objects.hashCode(source, containerType, sha1Checksum);
-      }
+   public abstract String id();
 
-      /**
-       * {@inheritDoc}
-       */
-      @Override
-      public boolean equals(Object obj) {
-         if (this == obj) return true;
-         if (obj == null || getClass() != obj.getClass()) return false;
-         RawDisk that = RawDisk.class.cast(obj);
-         return equal(this.source, that.source)
-                 && equal(this.containerType, that.containerType)
-                 && equal(this.sha1Checksum, that.sha1Checksum);
-      }
+   public abstract URI selfLink();
 
-      protected Objects.ToStringHelper string() {
-         return toStringHelper(this)
-                 .omitNullValues()
-                 .add("source", source)
-                 .add("containerType", containerType)
-                 .add("sha1Checksum", sha1Checksum.orNull());
-      }
+   public abstract String name();
 
-      /**
-       * {@inheritDoc}
-       */
-      @Override
-      public String toString() {
-         return string().toString();
-      }
+   @Nullable public abstract String description();
 
-      public static Builder builder() {
-         return new Builder();
-      }
+   /** Must be RAW; provided by the client when the disk image is created. */
+   // TODO: if this is true, why bother listing it?
+   public abstract String sourceType();
 
-      public Builder toBuilder() {
-         return builder().fromImageRawDisk(this);
-      }
-
-      public static class Builder {
-
-         private String source;
-         private String containerType;
-         private String sha1Checksum;
-
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Image.RawDisk#getSource()
-          */
-         public Builder source(String source) {
-            this.source = checkNotNull(source);
-            return this;
-         }
+   @Nullable public abstract RawDisk rawDisk();
 
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Image.RawDisk#getContainerType()
-          */
-         public Builder containerType(String containerType) {
-            this.containerType = checkNotNull(containerType);
-            return this;
-         }
+   @Nullable public abstract Deprecated deprecated();
 
-         /**
-          * @see org.jclouds.googlecomputeengine.domain.Image.RawDisk#getSha1Checksum()
-          */
-         public Builder sha1Checksum(String sha1Checksum) {
-            this.sha1Checksum = sha1Checksum;
-            return this;
-         }
-
-         public RawDisk build() {
-            return new RawDisk(source, containerType, sha1Checksum);
-         }
+   @SerializedNames({ "id", "selfLink", "name", "description", "sourceType", "rawDisk", "deprecated" })
+   public static Image create(String id, URI selfLink, String name, String description, String sourceType,
+         RawDisk rawDisk, Deprecated deprecated) {
+      return new AutoValue_Image(id, selfLink, name, description, sourceType, rawDisk, deprecated);
+   }
 
-         public Builder fromImageRawDisk(RawDisk rawDisk) {
-            return new Builder().source(rawDisk.getSource())
-                    .containerType(rawDisk.getContainerType())
-                    .sha1Checksum(rawDisk.getSha1Checksum().orNull());
-         }
-      }
+   Image() {
    }
 }