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/10 18:19:40 UTC

[4/6] jclouds-labs-google git commit: * Removed the need for users to manually specify the current project name everywhere. * Documented why we implicitly lookup project name using project id; corrected README, pom, ApiMetadata and added tests. * I

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
index 6e5da47..debf050 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java
@@ -17,10 +17,11 @@
 package org.jclouds.googlecomputeengine.features;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
 
 import java.util.Iterator;
 
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -29,32 +30,32 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyIteratorOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyListPageOnNotFoundOr404;
+import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
 import org.jclouds.googlecomputeengine.domain.ListPage;
 import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.functions.internal.ParseRegions;
+import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
 import org.jclouds.googlecomputeengine.options.ListOptions;
 import org.jclouds.javax.annotation.Nullable;
 import org.jclouds.oauth.v2.config.OAuthScopes;
 import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
 import org.jclouds.rest.annotations.Fallback;
 import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
 import org.jclouds.rest.annotations.SkipEncoding;
 import org.jclouds.rest.annotations.Transform;
 
+import com.google.common.base.Function;
+
 @SkipEncoding({'/', '='})
 @RequestFilters(OAuthAuthenticationFilter.class)
 @Path("/regions")
 @Consumes(APPLICATION_JSON)
+@OAuthScopes(COMPUTE_READONLY_SCOPE)
 public interface RegionApi {
 
    /** Returns a region by name or null if not found. */
    @Named("Regions:get")
    @GET
    @Path("/{region}")
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
    @Fallback(NullOnNotFoundOr404.class)
    Region get(@PathParam("region") String region);
 
@@ -63,36 +64,40 @@ public interface RegionApi {
     * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
     * been set.
     *
-    * @param token       marks the beginning of the next list page
+    * @param pageToken   marks the beginning of the next list page
     * @param listOptions listing options
     * @return a page of the list
     */
    @Named("Regions:list")
    @GET
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseRegions.class)
-   @Fallback(EmptyListPageOnNotFoundOr404.class)
-   ListPage<Region> listPage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);
+   ListPage<Region> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Regions:list")
    @GET
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseRegions.class)
-   @Transform(ParseRegions.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(RegionPages.class)
    Iterator<ListPage<Region>> list();
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Regions:list")
    @GET
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseRegions.class)
-   @Transform(ParseRegions.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(RegionPages.class)
    Iterator<ListPage<Region>> list(ListOptions options);
+
+   static final class RegionPages extends BaseToIteratorOfListPage<Region, RegionPages> {
+
+      private final GoogleComputeEngineApi api;
+
+      @Inject RegionPages(GoogleComputeEngineApi api) {
+         this.api = api;
+      }
+
+      @Override protected Function<String, ListPage<Region>> fetchNextPage(final ListOptions options) {
+         return new Function<String, ListPage<Region>>() {
+            @Override public ListPage<Region> apply(String pageToken) {
+               return api.regions().listPage(pageToken, options);
+            }
+         };
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
index 70594e2..d1f1938 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java
@@ -17,12 +17,13 @@
 package org.jclouds.googlecomputeengine.features;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE;
 
 import java.net.URI;
 import java.util.Iterator;
 
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -34,13 +35,12 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyIteratorOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyListPageOnNotFoundOr404;
+import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
 import org.jclouds.googlecomputeengine.binders.RouteBinder;
 import org.jclouds.googlecomputeengine.domain.ListPage;
 import org.jclouds.googlecomputeengine.domain.Operation;
 import org.jclouds.googlecomputeengine.domain.Route;
-import org.jclouds.googlecomputeengine.functions.internal.ParseRoutes;
+import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
 import org.jclouds.googlecomputeengine.options.ListOptions;
 import org.jclouds.googlecomputeengine.options.RouteOptions;
 import org.jclouds.javax.annotation.Nullable;
@@ -50,10 +50,11 @@ import org.jclouds.rest.annotations.Fallback;
 import org.jclouds.rest.annotations.MapBinder;
 import org.jclouds.rest.annotations.PayloadParam;
 import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
 import org.jclouds.rest.annotations.SkipEncoding;
 import org.jclouds.rest.annotations.Transform;
 
+import com.google.common.base.Function;
+
 @SkipEncoding({'/', '='})
 @RequestFilters(OAuthAuthenticationFilter.class)
 @Path("/routes")
@@ -102,36 +103,43 @@ public interface RouteApi {
     * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
     * been set.
     *
-    * @param token       marks the beginning of the next list page
+    * @param pageToken   marks the beginning of the next list page
     * @param listOptions listing options
     * @return a page of the list
     */
    @Named("Routes:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseRoutes.class)
-   @Fallback(EmptyListPageOnNotFoundOr404.class)
-   ListPage<Route> listPage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);
+   ListPage<Route> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Routes:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseRoutes.class)
-   @Transform(ParseRoutes.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(RoutePages.class)
    Iterator<ListPage<Route>> list();
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Routes:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseRoutes.class)
-   @Transform(ParseRoutes.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(RoutePages.class)
    Iterator<ListPage<Route>> list(ListOptions options);
+
+   static final class RoutePages extends BaseToIteratorOfListPage<Route, RoutePages> {
+
+      private final GoogleComputeEngineApi api;
+
+      @Inject RoutePages(GoogleComputeEngineApi api) {
+         this.api = api;
+      }
+
+      @Override protected Function<String, ListPage<Route>> fetchNextPage(final ListOptions options) {
+         return new Function<String, ListPage<Route>>() {
+            @Override public ListPage<Route> apply(String pageToken) {
+               return api.routes().listPage(pageToken, options);
+            }
+         };
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
index f3741a7..4b65417 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java
@@ -17,11 +17,12 @@
 package org.jclouds.googlecomputeengine.features;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE;
 
 import java.util.Iterator;
 
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -31,22 +32,22 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyIteratorOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyListPageOnNotFoundOr404;
+import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
 import org.jclouds.googlecomputeengine.domain.ListPage;
 import org.jclouds.googlecomputeengine.domain.Operation;
 import org.jclouds.googlecomputeengine.domain.Snapshot;
-import org.jclouds.googlecomputeengine.functions.internal.ParseSnapshots;
+import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
 import org.jclouds.googlecomputeengine.options.ListOptions;
 import org.jclouds.javax.annotation.Nullable;
 import org.jclouds.oauth.v2.config.OAuthScopes;
 import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
 import org.jclouds.rest.annotations.Fallback;
 import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
 import org.jclouds.rest.annotations.SkipEncoding;
 import org.jclouds.rest.annotations.Transform;
 
+import com.google.common.base.Function;
+
 @SkipEncoding({'/', '='})
 @RequestFilters(OAuthAuthenticationFilter.class)
 @Path("/snapshots")
@@ -76,36 +77,43 @@ public interface SnapshotApi {
     * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
     * been set.
     *
-    * @param token       marks the beginning of the next list page
+    * @param pageToken   marks the beginning of the next list page
     * @param listOptions listing options
     * @return a page of the list
     */
    @Named("Snapshots:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseSnapshots.class)
-   @Fallback(EmptyListPageOnNotFoundOr404.class)
-   ListPage<Snapshot> listPage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);
+   ListPage<Snapshot> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Snapshots:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseSnapshots.class)
-   @Transform(ParseSnapshots.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(SnapshotPages.class)
    Iterator<ListPage<Snapshot>> list();
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Snapshots:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseSnapshots.class)
-   @Transform(ParseSnapshots.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(SnapshotPages.class)
    Iterator<ListPage<Snapshot>> list(ListOptions options);
+
+   static final class SnapshotPages extends BaseToIteratorOfListPage<Snapshot, SnapshotPages> {
+
+      private final GoogleComputeEngineApi api;
+
+      @Inject SnapshotPages(GoogleComputeEngineApi api) {
+         this.api = api;
+      }
+
+      @Override protected Function<String, ListPage<Snapshot>> fetchNextPage(final ListOptions options) {
+         return new Function<String, ListPage<Snapshot>>() {
+            @Override public ListPage<Snapshot> apply(String pageToken) {
+               return api.snapshots().listPage(pageToken, options);
+            }
+         };
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
index 7054563..ff15fab 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/TargetPoolApi.java
@@ -17,13 +17,14 @@
 package org.jclouds.googlecomputeengine.features;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_SCOPE;
 
 import java.net.URI;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
@@ -35,15 +36,14 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyIteratorOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyListPageOnNotFoundOr404;
+import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
 import org.jclouds.googlecomputeengine.binders.TargetPoolChangeHealthChecksBinder;
 import org.jclouds.googlecomputeengine.binders.TargetPoolChangeInstancesBinder;
 import org.jclouds.googlecomputeengine.binders.TargetPoolCreationBinder;
 import org.jclouds.googlecomputeengine.domain.ListPage;
 import org.jclouds.googlecomputeengine.domain.Operation;
 import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.functions.internal.ParseTargetPools;
+import org.jclouds.googlecomputeengine.internal.BaseCallerArg0ToIteratorOfListPage;
 import org.jclouds.googlecomputeengine.options.ListOptions;
 import org.jclouds.googlecomputeengine.options.TargetPoolCreationOptions;
 import org.jclouds.javax.annotation.Nullable;
@@ -53,11 +53,12 @@ import org.jclouds.rest.annotations.Fallback;
 import org.jclouds.rest.annotations.MapBinder;
 import org.jclouds.rest.annotations.PayloadParam;
 import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
 import org.jclouds.rest.annotations.SkipEncoding;
 import org.jclouds.rest.annotations.Transform;
 import org.jclouds.rest.binders.BindToJsonPayload;
 
+import com.google.common.base.Function;
+
 @SkipEncoding({'/', '='})
 @RequestFilters(OAuthAuthenticator.class)
 @Path("/targetPools")
@@ -210,36 +211,45 @@ public interface TargetPoolApi {
     * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
     * been set.
     *
-    * @param token       marks the beginning of the next list page
+    * @param pageToken   marks the beginning of the next list page
     * @param listOptions listing options
     * @return a page of the list
     */
    @Named("TargetPools:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseTargetPools.class)
-   @Fallback(EmptyListPageOnNotFoundOr404.class)
-   ListPage<TargetPool> listPage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);
+   ListPage<TargetPool> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("TargetPools:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseTargetPools.class)
-   @Transform(ParseTargetPools.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(TargetPoolPages.class)
    Iterator<ListPage<TargetPool>> list();
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("TargetPools:list")
    @GET
    @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseTargetPools.class)
-   @Transform(ParseTargetPools.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(TargetPoolPages.class)
    Iterator<ListPage<TargetPool>> list(ListOptions options);
+
+   static final class TargetPoolPages extends BaseCallerArg0ToIteratorOfListPage<TargetPool, TargetPoolPages> {
+
+      private final GoogleComputeEngineApi api;
+
+      @Inject TargetPoolPages(GoogleComputeEngineApi api) {
+         this.api = api;
+      }
+
+      @Override
+      protected Function<String, ListPage<TargetPool>> fetchNextPage(final String regionName,
+            final ListOptions options) {
+         return new Function<String, ListPage<TargetPool>>() {
+            @Override public ListPage<TargetPool> apply(String pageToken) {
+               return api.targetPoolsInRegion(regionName).listPage(pageToken, options);
+            }
+         };
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
index 61716e3..359518f 100644
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
+++ b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java
@@ -17,10 +17,11 @@
 package org.jclouds.googlecomputeengine.features;
 
 import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
-import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE;
+import static org.jclouds.googlecomputeengine.config.GoogleComputeEngineScopes.COMPUTE_READONLY_SCOPE;
 
 import java.util.Iterator;
 
+import javax.inject.Inject;
 import javax.inject.Named;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -29,32 +30,32 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 
 import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyIteratorOnNotFoundOr404;
-import org.jclouds.googlecomputeengine.GoogleComputeEngineFallbacks.EmptyListPageOnNotFoundOr404;
+import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
 import org.jclouds.googlecomputeengine.domain.ListPage;
 import org.jclouds.googlecomputeengine.domain.Zone;
-import org.jclouds.googlecomputeengine.functions.internal.ParseZones;
+import org.jclouds.googlecomputeengine.internal.BaseToIteratorOfListPage;
 import org.jclouds.googlecomputeengine.options.ListOptions;
 import org.jclouds.javax.annotation.Nullable;
 import org.jclouds.oauth.v2.config.OAuthScopes;
 import org.jclouds.oauth.v2.filters.OAuthAuthenticationFilter;
 import org.jclouds.rest.annotations.Fallback;
 import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
 import org.jclouds.rest.annotations.SkipEncoding;
 import org.jclouds.rest.annotations.Transform;
 
+import com.google.common.base.Function;
+
 @SkipEncoding({'/', '='})
 @RequestFilters(OAuthAuthenticationFilter.class)
 @Path("/zones")
 @Consumes(APPLICATION_JSON)
+@OAuthScopes(COMPUTE_READONLY_SCOPE)
 public interface ZoneApi {
 
    /** Returns a zone by name or null if not found. */
    @Named("Zones:get")
    @GET
    @Path("/{zone}")
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
    @Fallback(NullOnNotFoundOr404.class)
    Zone get(@PathParam("zone") String zone);
 
@@ -63,36 +64,40 @@ public interface ZoneApi {
     * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not
     * been set.
     *
-    * @param token       marks the beginning of the next list page
+    * @param pageToken   marks the beginning of the next list page
     * @param listOptions listing options
     * @return a page of the list
     */
    @Named("Zones:list")
    @GET
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseZones.class)
-   @Fallback(EmptyListPageOnNotFoundOr404.class)
-   ListPage<Zone> listPage(@Nullable @QueryParam("pageToken") String token, ListOptions listOptions);
+   ListPage<Zone> listPage(@Nullable @QueryParam("pageToken") String pageToken, ListOptions listOptions);
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Zones:list")
    @GET
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseZones.class)
-   @Transform(ParseZones.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(ZonePages.class)
    Iterator<ListPage<Zone>> list();
 
-   /**
-    * @see #list(org.jclouds.googlecomputeengine.options.ListOptions)
-    */
+   /** @see #listPage(String, ListOptions) */
    @Named("Zones:list")
    @GET
-   @OAuthScopes(COMPUTE_READONLY_SCOPE)
-   @ResponseParser(ParseZones.class)
-   @Transform(ParseZones.ToIteratorOfListPage.class)
-   @Fallback(EmptyIteratorOnNotFoundOr404.class)
+   @Transform(ZonePages.class)
    Iterator<ListPage<Zone>> list(ListOptions options);
+
+   static final class ZonePages extends BaseToIteratorOfListPage<Zone, ZonePages> {
+
+      private final GoogleComputeEngineApi api;
+
+      @Inject ZonePages(GoogleComputeEngineApi api) {
+         this.api = api;
+      }
+
+      @Override protected Function<String, ListPage<Zone>> fetchNextPage(final ListOptions options) {
+         return new Function<String, ListPage<Zone>>() {
+            @Override public ListPage<Zone> apply(String pageToken) {
+               return api.zones().listPage(pageToken, options);
+            }
+         };
+      }
+   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/AdvancingIterator.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/AdvancingIterator.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/AdvancingIterator.java
deleted file mode 100644
index 73054b4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/AdvancingIterator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import org.jclouds.googlecomputeengine.domain.ListPage;
-
-import com.google.common.base.Function;
-import com.google.common.collect.AbstractIterator;
-
-final class AdvancingIterator<T> extends AbstractIterator<ListPage<T>> {
-
-   private final Function<String, ListPage<T>> tokenToNext;
-   private ListPage<T> current;
-   private boolean unread = true;
-
-   AdvancingIterator(ListPage<T> initial, Function<String, ListPage<T>> tokenToNext) {
-      this.current = initial;
-      this.tokenToNext = tokenToNext;
-   }
-
-   @Override protected ListPage<T> computeNext() {
-      if (unread) {
-         try {
-            return current;
-         } finally {
-            unread = false;
-         }
-      } else if (current.nextPageToken() != null) {
-         return current = tokenToNext.apply(current.nextPageToken());
-      } else {
-         return endOfData();
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToIteratorOfListPage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToIteratorOfListPage.java
deleted file mode 100644
index ec07bb5..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseToIteratorOfListPage.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import static com.google.common.base.Predicates.instanceOf;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Iterator;
-
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.InvocationContext;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.collect.Iterators;
-
-@Beta
-public abstract class BaseToIteratorOfListPage<T, I extends BaseToIteratorOfListPage<T, I>>
-      implements Function<ListPage<T>, Iterator<ListPage<T>>>, InvocationContext<I> {
-
-   private GeneratedHttpRequest request;
-
-   @Override
-   public Iterator<ListPage<T>> apply(ListPage<T> input) {
-      if (input.nextPageToken() == null) {
-         return input.isEmpty() ? Iterators.<ListPage<T>>emptyIterator() : Iterators.singletonIterator(input);
-      }
-
-      Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class));
-
-      return new AdvancingIterator<T>(input,
-            fetchNextPage((String) request.getCaller().get().getArgs().get(0), (ListOptions) listOptions.orNull()));
-   }
-
-   protected abstract Function<String, ListPage<T>> fetchNextPage(String projectName, ListOptions listOptions);
-
-   @SuppressWarnings("unchecked")
-   @Override
-   public I setContext(HttpRequest request) {
-      this.request = GeneratedHttpRequest.class.cast(request);
-      return (I) this;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToIteratorOfListPage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToIteratorOfListPage.java
deleted file mode 100644
index 54cbd5b..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithRegionToIteratorOfListPage.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import static com.google.common.base.Predicates.instanceOf;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.InvocationContext;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.collect.Iterators;
-
-@Beta
-abstract class BaseWithRegionToIteratorOfListPage<T, I extends BaseWithRegionToIteratorOfListPage<T, I>>
-      implements Function<ListPage<T>, Iterator<ListPage<T>>>, InvocationContext<I> {
-
-   GeneratedHttpRequest request;
-
-   @Override public Iterator<ListPage<T>> apply(ListPage<T> input) {
-      if (input.nextPageToken() == null)
-         return Iterators.singletonIterator(input);
-
-      List<Object> callerArgs = request.getCaller().get().getArgs();
-
-      assert callerArgs.size() == 2 : String.format("programming error, method %s should have 2 args: project, region",
-            request.getCaller().get().getInvokable());
-
-      Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class));
-
-      return new AdvancingIterator<T>(input,
-            fetchNextPage((String) callerArgs.get(0), (String) callerArgs.get(1), (ListOptions) listOptions.orNull()));
-   }
-
-   protected abstract Function<String, ListPage<T>> fetchNextPage(String projectName,
-                                                                  String regionName,
-                                                                  ListOptions listOptions);
-
-   @SuppressWarnings("unchecked")
-   @Override
-   public I setContext(HttpRequest request) {
-      this.request = GeneratedHttpRequest.class.cast(request);
-      return (I) this;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToIteratorOfListPage.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToIteratorOfListPage.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToIteratorOfListPage.java
deleted file mode 100644
index 5c54f84..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/BaseWithZoneToIteratorOfListPage.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import static com.google.common.base.Predicates.instanceOf;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.InvocationContext;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.collect.Iterators;
-
-@Beta
-abstract class BaseWithZoneToIteratorOfListPage<T, I extends BaseWithZoneToIteratorOfListPage<T, I>>
-      implements Function<ListPage<T>, Iterator<ListPage<T>>>, InvocationContext<I> {
-
-   GeneratedHttpRequest request;
-
-   @Override public Iterator<ListPage<T>> apply(ListPage<T> input) {
-      if (input.nextPageToken() == null) {
-         return Iterators.singletonIterator(input);
-      }
-
-      List<Object> callerArgs = request.getCaller().get().getArgs();
-
-      assert callerArgs.size() == 2 : String.format("programming error, method %s should have 2 args: project, zone",
-            request.getCaller().get().getInvokable());
-
-      Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class));
-
-      return new AdvancingIterator<T>(input,
-            fetchNextPage((String) callerArgs.get(0), (String) callerArgs.get(1), (ListOptions) listOptions.orNull()));
-   }
-
-   protected abstract Function<String, ListPage<T>> fetchNextPage(String projectName,
-                                                                  String zoneName,
-                                                                  ListOptions listOptions);
-
-   @SuppressWarnings("unchecked")
-   @Override
-   public I setContext(HttpRequest request) {
-      this.request = GeneratedHttpRequest.class.cast(request);
-      return (I) this;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java
deleted file mode 100644
index 4e287dc..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/PATCH.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.ws.rs.HttpMethod;
-
-/**
- * Indicates that the annotated method responds to HTTP PATCH requests
- *
- * @see javax.ws.rs.HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod("PATCH")
-public @interface PATCH {
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java
deleted file mode 100644
index 35dd2c1..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseAddresses.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Address;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseAddresses extends ParseJson<ListPage<Address>> {
-
-   @Inject ParseAddresses(Json json) {
-      super(json, new TypeLiteral<ListPage<Address>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage extends BaseWithRegionToIteratorOfListPage<Address, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Address>> fetchNextPage(final String projectName,
-            final String regionName, final ListOptions options) {
-         return new Function<String, ListPage<Address>>() {
-            @Override public ListPage<Address> apply(String input) {
-               return api.getAddressApi(projectName, regionName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDiskTypes.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDiskTypes.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDiskTypes.java
deleted file mode 100644
index e9aa54f..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDiskTypes.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.DiskType;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseDiskTypes extends ParseJson<ListPage<DiskType>> {
-
-   @Inject ParseDiskTypes(Json json) {
-      super(json, new TypeLiteral<ListPage<DiskType>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage extends BaseWithZoneToIteratorOfListPage<DiskType, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<DiskType>> fetchNextPage(final String projectName,
-            final String zoneName, final ListOptions options) {
-         return new Function<String, ListPage<DiskType>>() {
-            @Override public ListPage<DiskType> apply(String input) {
-               return api.getDiskTypeApi(projectName, zoneName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java
deleted file mode 100644
index 6a8173b..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseDisks.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Disk;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseDisks extends ParseJson<ListPage<Disk>> {
-
-   @Inject ParseDisks(Json json) {
-      super(json, new TypeLiteral<ListPage<Disk>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage extends BaseWithZoneToIteratorOfListPage<Disk, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Disk>> fetchNextPage(final String projectName,
-            final String zoneName, final ListOptions options) {
-         return new Function<String, ListPage<Disk>>() {
-
-            @Override public ListPage<Disk> apply(String input) {
-               return api.getDiskApi(projectName, zoneName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java
deleted file mode 100644
index cfe8605..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseFirewalls.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Firewall;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseFirewalls extends ParseJson<ListPage<Firewall>> {
-
-   @Inject ParseFirewalls(Json json) {
-      super(json, new TypeLiteral<ListPage<Firewall>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Firewall, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Firewall>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Firewall>>() {
-            @Override public ListPage<Firewall> apply(String input) {
-               return api.getFirewallApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java
deleted file mode 100644
index e8fc15d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseForwardingRules.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ForwardingRule;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseForwardingRules extends ParseJson<ListPage<ForwardingRule>> {
-
-   @Inject ParseForwardingRules(Json json) {
-      super(json, new TypeLiteral<ListPage<ForwardingRule>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage
-         extends BaseWithRegionToIteratorOfListPage<ForwardingRule, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<ForwardingRule>> fetchNextPage(final String projectName,
-            final String regionName,
-            final ListOptions options) {
-         return new Function<String, ListPage<ForwardingRule>>() {
-            @Override public ListPage<ForwardingRule> apply(String input) {
-               return api.getForwardingRuleApi(projectName, regionName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java
deleted file mode 100644
index 738dacd..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseGlobalOperations.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseGlobalOperations extends ParseJson<ListPage<Operation>> {
-
-   @Inject ParseGlobalOperations(Json json) {
-      super(json, new TypeLiteral<ListPage<Operation>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Operation, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override
-      protected Function<String, ListPage<Operation>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Operation>>() {
-            @Override public ListPage<Operation> apply(String input) {
-               return api.getOperationApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java
deleted file mode 100644
index da034e2..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseHttpHealthChecks.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.HttpHealthCheck;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseHttpHealthChecks extends ParseJson<ListPage<HttpHealthCheck>> {
-
-   @Inject ParseHttpHealthChecks(Json json) {
-      super(json, new TypeLiteral<ListPage<HttpHealthCheck>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage extends BaseToIteratorOfListPage<HttpHealthCheck, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = checkNotNull(api, "api");
-      }
-
-      @Override protected Function<String, ListPage<HttpHealthCheck>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<HttpHealthCheck>>() {
-
-            @Override public ListPage<HttpHealthCheck> apply(String input) {
-               return api.getHttpHealthCheckApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java
deleted file mode 100644
index dfdabc2..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseImages.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Image;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseImages extends ParseJson<ListPage<Image>> {
-
-   @Inject ParseImages(Json json) {
-      super(json, new TypeLiteral<ListPage<Image>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Image, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Image>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Image>>() {
-            @Override public ListPage<Image> apply(String input) {
-               return api.getImageApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java
deleted file mode 100644
index e581ec4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseInstances.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.Instance;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseInstances extends ParseJson<ListPage<Instance>> {
-
-   @Inject ParseInstances(Json json) {
-      super(json, new TypeLiteral<ListPage<Instance>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage
-         extends BaseWithZoneToIteratorOfListPage<Instance, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Instance>> fetchNextPage(final String project, final String zone,
-            final ListOptions options) {
-         return new Function<String, ListPage<Instance>>() {
-            @Override public ListPage<Instance> apply(String input) {
-               return api.getInstanceApi(project, zone).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java
deleted file mode 100644
index 284f7cc..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseMachineTypes.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.MachineType;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseMachineTypes extends ParseJson<ListPage<MachineType>> {
-
-   @Inject ParseMachineTypes(Json json) {
-      super(json, new TypeLiteral<ListPage<MachineType>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage extends BaseWithZoneToIteratorOfListPage<MachineType, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<MachineType>> fetchNextPage(final String projectName,
-            final String zoneName, final ListOptions options) {
-         return new Function<String, ListPage<MachineType>>() {
-
-            @Override public ListPage<MachineType> apply(String input) {
-               return api.getMachineTypeApi(projectName, zoneName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java
deleted file mode 100644
index ad0837c..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseNetworks.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Network;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseNetworks extends ParseJson<ListPage<Network>> {
-
-   @Inject ParseNetworks(Json json) {
-      super(json, new TypeLiteral<ListPage<Network>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Network, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Network>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Network>>() {
-            @Override public ListPage<Network> apply(String input) {
-               return api.getNetworkApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java
deleted file mode 100644
index 506f31d..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegionOperations.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import static com.google.common.base.Predicates.instanceOf;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Iterator;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Operation;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.collect.Iterators;
-import com.google.inject.TypeLiteral;
-
-public final class ParseRegionOperations extends ParseJson<ListPage<Operation>> {
-
-   @Inject ParseRegionOperations(Json json) {
-      super(json, new TypeLiteral<ListPage<Operation>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage
-         extends BaseWithRegionToIteratorOfListPage<Operation, ToIteratorOfListPage> {
-
-      @Override public Iterator<ListPage<Operation>> apply(ListPage<Operation> input) {
-         if (input.nextPageToken() == null) {
-            return Iterators.singletonIterator(input);
-         }
-
-         String project = (String) request.getCaller().get().getArgs().get(0);
-         String region = (String) request.getInvocation().getArgs().get(0);
-
-         Optional<Object> listOptions = tryFind(request.getInvocation().getArgs(), instanceOf(ListOptions.class));
-
-         return new AdvancingIterator<Operation>(input,
-               fetchNextPage(project, region, (ListOptions) listOptions.orNull()));
-      }
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Operation>> fetchNextPage(final String projectName,
-            final String regionName, final ListOptions options) {
-         return new Function<String, ListPage<Operation>>() {
-            @Override public ListPage<Operation> apply(String input) {
-               return api.getOperationApi(projectName).listPageInRegion(regionName, input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java
deleted file mode 100644
index e2fe73f..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRegions.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Region;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseRegions extends ParseJson<ListPage<Region>> {
-
-   @Inject ParseRegions(Json json) {
-      super(json, new TypeLiteral<ListPage<Region>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Region, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Region>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Region>>() {
-            @Override public ListPage<Region> apply(String input) {
-               return api.getRegionApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java
deleted file mode 100644
index c56c9e4..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseRoutes.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Route;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseRoutes extends ParseJson<ListPage<Route>> {
-
-   @Inject ParseRoutes(Json json) {
-      super(json, new TypeLiteral<ListPage<Route>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Route, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override
-      protected Function<String, ListPage<Route>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Route>>() {
-            @Override public ListPage<Route> apply(String input) {
-               return api.getRouteApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java
deleted file mode 100644
index 2265012..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseSnapshots.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.Snapshot;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseSnapshots extends ParseJson<ListPage<Snapshot>> {
-
-   @Inject ParseSnapshots(Json json) {
-      super(json, new TypeLiteral<ListPage<Snapshot>>() {
-      });
-   }
-
-   public static final class ToIteratorOfListPage extends BaseToIteratorOfListPage<Snapshot, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = api;
-      }
-
-      @Override protected Function<String, ListPage<Snapshot>> fetchNextPage(final String projectName,
-            final ListOptions options) {
-         return new Function<String, ListPage<Snapshot>>() {
-            @Override public ListPage<Snapshot> apply(String input) {
-               return api.getSnapshotApi(projectName).listPage(input, options);
-            }
-         };
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/37e0397d/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java
----------------------------------------------------------------------
diff --git a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java b/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java
deleted file mode 100644
index d23ab07..0000000
--- a/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseTargetPools.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.googlecomputeengine.functions.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-
-import org.jclouds.googlecomputeengine.GoogleComputeEngineApi;
-import org.jclouds.googlecomputeengine.domain.ListPage;
-import org.jclouds.googlecomputeengine.domain.TargetPool;
-import org.jclouds.googlecomputeengine.options.ListOptions;
-import org.jclouds.http.functions.ParseJson;
-import org.jclouds.json.Json;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-public final class ParseTargetPools extends ParseJson<ListPage<TargetPool>> {
-
-   @Inject ParseTargetPools(Json json) {
-      super(json, new TypeLiteral<ListPage<TargetPool>>() {
-      });
-   }
-
-   public static class ToIteratorOfListPage extends BaseWithZoneToIteratorOfListPage<TargetPool, ToIteratorOfListPage> {
-
-      private final GoogleComputeEngineApi api;
-
-      @Inject ToIteratorOfListPage(GoogleComputeEngineApi api) {
-         this.api = checkNotNull(api, "api");
-      }
-
-      @Override protected Function<String, ListPage<TargetPool>> fetchNextPage(final String projectName,
-                                                                         final String regionName,
-                                                                         final ListOptions options) {
-         return new Function<String, ListPage<TargetPool>>() {
-
-            @Override
-            public ListPage<TargetPool> apply(String input) {
-               return api.getTargetPoolApi(projectName, regionName).listPage(input, options);
-            }
-         };
-      }
-   }
-}