Package com.google.api.services.fusiontables

Source Code of com.google.api.services.fusiontables.Fusiontables$Column$Get

/*
* Copyright 2010 Google Inc.
*
* Licensed 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.
*/
/*
* This file was generated.
*  with google-apis-code-generator 1.2.0 (build: 2012-10-03 02:48:15 UTC)
*  on 2012-10-14 at 05:14:46 UTC
*/

package com.google.api.services.fusiontables;

import com.google.api.client.googleapis.services.GoogleClient;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpMethod;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.json.JsonHttpRequest;
import com.google.api.client.http.json.JsonHttpRequestInitializer;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.json.JsonString;
import com.google.common.base.Preconditions;

import java.io.IOException;

/**
* Service definition for Fusiontables (v1).
*
* <p>
* API for working with Fusion Tables data.
* </p>
*
* <p>
* For more information about this service, see the
* <a href="https://developers.google.com/fusiontables" target="_blank">API Documentation</a>
* </p>
*
* <p>
* This service uses {@link JsonHttpRequestInitializer} to initialize global parameters via its
* {@link Builder}. Sample usage:
* </p>
*
* <pre>
  public class FusiontablesRequestInitializer implements JsonHttpRequestInitializer {
      public void initialize(JsonHttpRequest request) {
        FusiontablesRequest fusiontablesRequest = (FusiontablesRequest)request;
        fusiontablesRequest.setPrettyPrint(true);
        fusiontablesRequest.setKey(ClientCredentials.KEY);
    }
  }
* </pre>
*
* @since 1.3.0
* @author Google, Inc.
*/
public class Fusiontables extends GoogleClient {

  /**
   * The default encoded base path of the service. This is determined when the library is generated
   * and normally should not be changed.
   * @deprecated (scheduled to be removed in 1.8) Use "/" + {@link #DEFAULT_SERVICE_PATH}.
   */
  @Deprecated
  public static final String DEFAULT_BASE_PATH = "/fusiontables/v1/";

  /**
   * The default encoded root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_ROOT_URL = "https://www.googleapis.com/";

  /**
   * The default encoded service path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_SERVICE_PATH = "fusiontables/v1/";

  /**
   * The default encoded base URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   */
  public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;

  /**
   * Construct a Fusiontables instance to connect to the Fusiontables service.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport The transport to use for requests
   * @param jsonFactory A factory for creating JSON parsers and serializers
   * @deprecated (scheduled to be removed in 1.8) Use
   *             {@link #Fusiontables(HttpTransport, JsonFactory, HttpRequestInitializer)}.
   */
  @Deprecated
  public Fusiontables(HttpTransport transport, JsonFactory jsonFactory) {
    super(transport, jsonFactory, DEFAULT_BASE_URL);
  }

  /**
   * Construct a Fusiontables instance to connect to the Fusiontables service.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport The transport to use for requests
   * @param jsonFactory A factory for creating JSON parsers and serializers
   * @param httpRequestInitializer The HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public Fusiontables(HttpTransport transport, JsonFactory jsonFactory,
      HttpRequestInitializer httpRequestInitializer) {
    super(transport, jsonFactory, DEFAULT_ROOT_URL, DEFAULT_SERVICE_PATH, httpRequestInitializer);
  }

  /**
   * Construct a Fusiontables instance to connect to the Fusiontables service.
   *
   * @param transport The transport to use for requests
   * @param jsonHttpRequestInitializer The initializer to use when creating an JSON HTTP request
   * @param httpRequestInitializer The initializer to use when creating an {@link HttpRequest}
   * @param jsonFactory A factory for creating JSON parsers and serializers
   * @param jsonObjectParser JSON parser to use or {@code null} if unused
   * @param baseUrl The base URL of the service on the server
   * @param applicationName The application name to be sent in the User-Agent header of requests
   */
  @Deprecated
  Fusiontables(
      HttpTransport transport,
      JsonHttpRequestInitializer jsonHttpRequestInitializer,
      HttpRequestInitializer httpRequestInitializer,
      JsonFactory jsonFactory,
      JsonObjectParser jsonObjectParser,
      String baseUrl,
      String applicationName) {
      super(transport,
          jsonHttpRequestInitializer,
          httpRequestInitializer,
          jsonFactory,
          jsonObjectParser,
          baseUrl,
          applicationName);
  }

  /**
   * Construct a Fusiontables instance to connect to the Fusiontables service.
   *
   * @param transport The transport to use for requests
   * @param jsonHttpRequestInitializer The initializer to use when creating an JSON HTTP request
   * @param httpRequestInitializer The initializer to use when creating an {@link HttpRequest}
   * @param jsonFactory A factory for creating JSON parsers and serializers
   * @param jsonObjectParser JSON parser to use or {@code null} if unused
   * @param rootUrl The root URL of the service on the server
   * @param servicePath The service path of the service on the server
   * @param applicationName The application name to be sent in the User-Agent header of requests
   * @param suppressPatternChecks whether discovery pattern checks should be suppressed on required
   *        parameters
   */
  Fusiontables(
      HttpTransport transport,
      JsonHttpRequestInitializer jsonHttpRequestInitializer,
      HttpRequestInitializer httpRequestInitializer,
      JsonFactory jsonFactory,
      JsonObjectParser jsonObjectParser,
      String rootUrl,
      String servicePath,
      String applicationName,
      boolean suppressPatternChecks) {
      super(transport,
          jsonHttpRequestInitializer,
          httpRequestInitializer,
          jsonFactory,
          jsonObjectParser,
          rootUrl,
          servicePath,
          applicationName,
          suppressPatternChecks);
  }

  @Override
  protected void initialize(JsonHttpRequest jsonHttpRequest) throws IOException {
    super.initialize(jsonHttpRequest);
  }

  /**
   * Returns an instance of a new builder.
   *
   * @param transport The transport to use for requests
   * @param jsonFactory A factory for creating JSON parsers and serializers
   * @deprecated (scheduled to removed in 1.8) Use
   *             {@link Builder#Builder(HttpTransport, JsonFactory, HttpRequestInitializer)}.
   */
   @Deprecated
   public static Builder builder(HttpTransport transport, JsonFactory jsonFactory) {
     return new Builder(transport, jsonFactory, new GenericUrl(DEFAULT_BASE_URL));
   }

  /**
   * An accessor for creating requests from the Style collection.
   *
   * The typical use is:<pre>
   *   {@code Fusiontables fusiontables = new Fusiontables(...);}
   *   {@code Fusiontables.Style.List request = fusiontables.style().list(parameters ...)}</pre>
   *
   * @return the resource collection
   */
  public Style style() {
    return new Style();
  }

  /**
   * The "style" collection of methods.
   */
  public class Style {

    /**
     * Adds a new style for the table.
     *
     * Create a request for the method "style.insert".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param tableId Table for which a new style is being added
     * @param content the {@link com.google.api.services.fusiontables.model.StyleSetting}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Insert insert(String tableId, com.google.api.services.fusiontables.model.StyleSetting content) throws IOException {
      Insert result = new Insert(tableId, content);
      initialize(result);
      return result;
    }

    public class Insert extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/styles";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Insert(String tableId, com.google.api.services.fusiontables.model.StyleSetting content) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "insert" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.StyleSetting} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.StyleSetting execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.StyleSetting result = response.parseAs(
            com.google.api.services.fusiontables.model.StyleSetting.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "insert" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;StyleSetting&gt;() {

           public void onSuccess(StyleSetting content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.StyleSetting> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.StyleSetting.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Insert setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table for which a new style is being added */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table for which a new style is being added
       */
      public String getTableId() {
        return tableId;
      }

      /** Table for which a new style is being added */
      public Insert setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

    }
    /**
     * Gets a specific style.
     *
     * Create a request for the method "style.get".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param tableId Table to which the requested style belongs
     * @param styleId Identifier (integer) for a specific style in a table
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Get get(String tableId, Integer styleId) throws IOException {
      Get result = new Get(tableId, styleId);
      initialize(result);
      return result;
    }

    public class Get extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/styles/{styleId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Get(String tableId, Integer styleId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.styleId = Preconditions.checkNotNull(styleId, "Required parameter styleId must be specified.");
      }

      /**
       * Sends the "get" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.StyleSetting} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.StyleSetting execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.StyleSetting result = response.parseAs(
            com.google.api.services.fusiontables.model.StyleSetting.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "get" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;StyleSetting&gt;() {

           public void onSuccess(StyleSetting content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.StyleSetting> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.StyleSetting.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Get setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table to which the requested style belongs */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table to which the requested style belongs
       */
      public String getTableId() {
        return tableId;
      }

      /** Table to which the requested style belongs */
      public Get setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier (integer) for a specific style in a table */
      @com.google.api.client.util.Key
      private Integer styleId;

      /** Identifier (integer) for a specific style in a table
       */
      public Integer getStyleId() {
        return styleId;
      }

      /** Identifier (integer) for a specific style in a table */
      public Get setStyleId(Integer styleId) {
        this.styleId = styleId;
        return this;
      }

    }
    /**
     * Retrieves a list of styles.
     *
     * Create a request for the method "style.list".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param tableId Table whose styles are being listed
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public List list(String tableId) throws IOException {
      List result = new List(tableId);
      initialize(result);
      return result;
    }

    public class List extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/styles";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      List(String tableId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Sends the "list" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.StyleSettingList} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.StyleSettingList execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.StyleSettingList result = response.parseAs(
            com.google.api.services.fusiontables.model.StyleSettingList.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "list" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;StyleSettingList&gt;() {

           public void onSuccess(StyleSettingList content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.StyleSettingList> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.StyleSettingList.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public List setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table whose styles are being listed */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table whose styles are being listed
       */
      public String getTableId() {
        return tableId;
      }

      /** Table whose styles are being listed */
      public List setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Continuation token specifying which result page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Continuation token specifying which result page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Continuation token specifying which result page to return. Optional. */
      public List setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /** Maximum number of styles to return. Optional. Default is 5. */
      @com.google.api.client.util.Key
      private Long maxResults;

      /** Maximum number of styles to return. Optional. Default is 5.

     [minimum: 0]
       */
      public Long getMaxResults() {
        return maxResults;
      }

      /** Maximum number of styles to return. Optional. Default is 5. */
      public List setMaxResults(Long maxResults) {
        this.maxResults = maxResults;
        return this;
      }

    }
    /**
     * Updates an existing style.
     *
     * Create a request for the method "style.update".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param tableId Table whose style is being updated.
     * @param styleId Identifier (within a table) for the style being updated.
     * @param content the {@link com.google.api.services.fusiontables.model.StyleSetting}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Update update(String tableId, Integer styleId, com.google.api.services.fusiontables.model.StyleSetting content) throws IOException {
      Update result = new Update(tableId, styleId, content);
      initialize(result);
      return result;
    }

    public class Update extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/styles/{styleId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Update(String tableId, Integer styleId, com.google.api.services.fusiontables.model.StyleSetting content) {
        super(Fusiontables.this, HttpMethod.PUT, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.styleId = Preconditions.checkNotNull(styleId, "Required parameter styleId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "update" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.StyleSetting} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.StyleSetting execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.StyleSetting result = response.parseAs(
            com.google.api.services.fusiontables.model.StyleSetting.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "update" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;StyleSetting&gt;() {

           public void onSuccess(StyleSetting content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.StyleSetting> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.StyleSetting.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Update setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table whose style is being updated. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table whose style is being updated.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table whose style is being updated. */
      public Update setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier (within a table) for the style being updated. */
      @com.google.api.client.util.Key
      private Integer styleId;

      /** Identifier (within a table) for the style being updated.
       */
      public Integer getStyleId() {
        return styleId;
      }

      /** Identifier (within a table) for the style being updated. */
      public Update setStyleId(Integer styleId) {
        this.styleId = styleId;
        return this;
      }

    }
    /**
     * Updates an existing style. This method supports patch semantics.
     *
     * Create a request for the method "style.patch".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param tableId Table whose style is being updated.
     * @param styleId Identifier (within a table) for the style being updated.
     * @param content the {@link com.google.api.services.fusiontables.model.StyleSetting}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Patch patch(String tableId, Integer styleId, com.google.api.services.fusiontables.model.StyleSetting content) throws IOException {
      Patch result = new Patch(tableId, styleId, content);
      initialize(result);
      return result;
    }

    public class Patch extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/styles/{styleId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Patch(String tableId, Integer styleId, com.google.api.services.fusiontables.model.StyleSetting content) {
        super(Fusiontables.this, HttpMethod.PATCH, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.styleId = Preconditions.checkNotNull(styleId, "Required parameter styleId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "patch" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.StyleSetting} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.StyleSetting execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.StyleSetting result = response.parseAs(
            com.google.api.services.fusiontables.model.StyleSetting.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "patch" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;StyleSetting&gt;() {

           public void onSuccess(StyleSetting content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.StyleSetting> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.StyleSetting.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Patch setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table whose style is being updated. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table whose style is being updated.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table whose style is being updated. */
      public Patch setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier (within a table) for the style being updated. */
      @com.google.api.client.util.Key
      private Integer styleId;

      /** Identifier (within a table) for the style being updated.
       */
      public Integer getStyleId() {
        return styleId;
      }

      /** Identifier (within a table) for the style being updated. */
      public Patch setStyleId(Integer styleId) {
        this.styleId = styleId;
        return this;
      }

    }
    /**
     * Deletes a style.
     *
     * Create a request for the method "style.delete".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param tableId Table from which the style is being deleted
     * @param styleId Identifier (within a table) for the style being deleted
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Delete delete(String tableId, Integer styleId) throws IOException {
      Delete result = new Delete(tableId, styleId);
      initialize(result);
      return result;
    }

    public class Delete extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/styles/{styleId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Delete(String tableId, Integer styleId) {
        super(Fusiontables.this, HttpMethod.DELETE, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.styleId = Preconditions.checkNotNull(styleId, "Required parameter styleId must be specified.");
      }

      /**
       * Sends the "delete" request to the Fusiontables server.
       *
       * @throws IOException if the request fails
       */
      public void execute() throws IOException {
        HttpResponse response = executeUnparsed();
        response.ignore();
      }

      /**
       * Queues the "delete" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Void&gt;() {

           public void onSuccess(Void content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<Void> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), Void.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Delete setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table from which the style is being deleted */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table from which the style is being deleted
       */
      public String getTableId() {
        return tableId;
      }

      /** Table from which the style is being deleted */
      public Delete setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier (within a table) for the style being deleted */
      @com.google.api.client.util.Key
      private Integer styleId;

      /** Identifier (within a table) for the style being deleted
       */
      public Integer getStyleId() {
        return styleId;
      }

      /** Identifier (within a table) for the style being deleted */
      public Delete setStyleId(Integer styleId) {
        this.styleId = styleId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Column collection.
   *
   * The typical use is:<pre>
   *   {@code Fusiontables fusiontables = new Fusiontables(...);}
   *   {@code Fusiontables.Column.List request = fusiontables.column().list(parameters ...)}</pre>
   *
   * @return the resource collection
   */
  public Column column() {
    return new Column();
  }

  /**
   * The "column" collection of methods.
   */
  public class Column {

    /**
     * Adds a new column to the table.
     *
     * Create a request for the method "column.insert".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param tableId Table for which a new column is being added.
     * @param content the {@link com.google.api.services.fusiontables.model.Column}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Insert insert(String tableId, com.google.api.services.fusiontables.model.Column content) throws IOException {
      Insert result = new Insert(tableId, content);
      initialize(result);
      return result;
    }

    public class Insert extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/columns";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Insert(String tableId, com.google.api.services.fusiontables.model.Column content) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "insert" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Column} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Column execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Column result = response.parseAs(
            com.google.api.services.fusiontables.model.Column.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "insert" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Column&gt;() {

           public void onSuccess(Column content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Column> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Column.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Insert setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table for which a new column is being added. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table for which a new column is being added.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table for which a new column is being added. */
      public Insert setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

    }
    /**
     * Retrieves a specific column by its id.
     *
     * Create a request for the method "column.get".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param tableId Table to which the column belongs.
     * @param columnId Name or identifier for the column that is being requested.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Get get(String tableId, String columnId) throws IOException {
      Get result = new Get(tableId, columnId);
      initialize(result);
      return result;
    }

    public class Get extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/columns/{columnId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Get(String tableId, String columnId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.columnId = Preconditions.checkNotNull(columnId, "Required parameter columnId must be specified.");
      }

      /**
       * Sends the "get" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Column} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Column execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Column result = response.parseAs(
            com.google.api.services.fusiontables.model.Column.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "get" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Column&gt;() {

           public void onSuccess(Column content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Column> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Column.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Get setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table to which the column belongs. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table to which the column belongs.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table to which the column belongs. */
      public Get setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Name or identifier for the column that is being requested. */
      @com.google.api.client.util.Key
      private String columnId;

      /** Name or identifier for the column that is being requested.
       */
      public String getColumnId() {
        return columnId;
      }

      /** Name or identifier for the column that is being requested. */
      public Get setColumnId(String columnId) {
        this.columnId = columnId;
        return this;
      }

    }
    /**
     * Retrieves a list of columns.
     *
     * Create a request for the method "column.list".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param tableId Table whose columns are being listed.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public List list(String tableId) throws IOException {
      List result = new List(tableId);
      initialize(result);
      return result;
    }

    public class List extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/columns";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      List(String tableId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Sends the "list" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.ColumnList} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.ColumnList execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.ColumnList result = response.parseAs(
            com.google.api.services.fusiontables.model.ColumnList.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "list" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;ColumnList&gt;() {

           public void onSuccess(ColumnList content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.ColumnList> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.ColumnList.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public List setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table whose columns are being listed. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table whose columns are being listed.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table whose columns are being listed. */
      public List setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Continuation token specifying which result page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Continuation token specifying which result page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Continuation token specifying which result page to return. Optional. */
      public List setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /** Maximum number of columns to return. Optional. Default is 5. */
      @com.google.api.client.util.Key
      private Long maxResults;

      /** Maximum number of columns to return. Optional. Default is 5.

     [minimum: 0]
       */
      public Long getMaxResults() {
        return maxResults;
      }

      /** Maximum number of columns to return. Optional. Default is 5. */
      public List setMaxResults(Long maxResults) {
        this.maxResults = maxResults;
        return this;
      }

    }
    /**
     * Updates the name or type of an existing column.
     *
     * Create a request for the method "column.update".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param tableId Table for which the column is being updated.
     * @param columnId Name or identifier for the column that is being updated.
     * @param content the {@link com.google.api.services.fusiontables.model.Column}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Update update(String tableId, String columnId, com.google.api.services.fusiontables.model.Column content) throws IOException {
      Update result = new Update(tableId, columnId, content);
      initialize(result);
      return result;
    }

    public class Update extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/columns/{columnId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Update(String tableId, String columnId, com.google.api.services.fusiontables.model.Column content) {
        super(Fusiontables.this, HttpMethod.PUT, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.columnId = Preconditions.checkNotNull(columnId, "Required parameter columnId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "update" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Column} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Column execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Column result = response.parseAs(
            com.google.api.services.fusiontables.model.Column.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "update" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Column&gt;() {

           public void onSuccess(Column content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Column> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Column.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Update setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table for which the column is being updated. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table for which the column is being updated.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table for which the column is being updated. */
      public Update setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Name or identifier for the column that is being updated. */
      @com.google.api.client.util.Key
      private String columnId;

      /** Name or identifier for the column that is being updated.
       */
      public String getColumnId() {
        return columnId;
      }

      /** Name or identifier for the column that is being updated. */
      public Update setColumnId(String columnId) {
        this.columnId = columnId;
        return this;
      }

    }
    /**
     * Updates the name or type of an existing column. This method supports patch semantics.
     *
     * Create a request for the method "column.patch".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param tableId Table for which the column is being updated.
     * @param columnId Name or identifier for the column that is being updated.
     * @param content the {@link com.google.api.services.fusiontables.model.Column}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Patch patch(String tableId, String columnId, com.google.api.services.fusiontables.model.Column content) throws IOException {
      Patch result = new Patch(tableId, columnId, content);
      initialize(result);
      return result;
    }

    public class Patch extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/columns/{columnId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Patch(String tableId, String columnId, com.google.api.services.fusiontables.model.Column content) {
        super(Fusiontables.this, HttpMethod.PATCH, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.columnId = Preconditions.checkNotNull(columnId, "Required parameter columnId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "patch" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Column} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Column execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Column result = response.parseAs(
            com.google.api.services.fusiontables.model.Column.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "patch" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Column&gt;() {

           public void onSuccess(Column content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Column> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Column.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Patch setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table for which the column is being updated. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table for which the column is being updated.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table for which the column is being updated. */
      public Patch setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Name or identifier for the column that is being updated. */
      @com.google.api.client.util.Key
      private String columnId;

      /** Name or identifier for the column that is being updated.
       */
      public String getColumnId() {
        return columnId;
      }

      /** Name or identifier for the column that is being updated. */
      public Patch setColumnId(String columnId) {
        this.columnId = columnId;
        return this;
      }

    }
    /**
     * Deletes the column.
     *
     * Create a request for the method "column.delete".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param tableId Table from which the column is being deleted.
     * @param columnId Name or identifier for the column being deleted.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Delete delete(String tableId, String columnId) throws IOException {
      Delete result = new Delete(tableId, columnId);
      initialize(result);
      return result;
    }

    public class Delete extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/columns/{columnId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Delete(String tableId, String columnId) {
        super(Fusiontables.this, HttpMethod.DELETE, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.columnId = Preconditions.checkNotNull(columnId, "Required parameter columnId must be specified.");
      }

      /**
       * Sends the "delete" request to the Fusiontables server.
       *
       * @throws IOException if the request fails
       */
      public void execute() throws IOException {
        HttpResponse response = executeUnparsed();
        response.ignore();
      }

      /**
       * Queues the "delete" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Void&gt;() {

           public void onSuccess(Void content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<Void> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), Void.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Delete setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table from which the column is being deleted. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table from which the column is being deleted.
       */
      public String getTableId() {
        return tableId;
      }

      /** Table from which the column is being deleted. */
      public Delete setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Name or identifier for the column being deleted. */
      @com.google.api.client.util.Key
      private String columnId;

      /** Name or identifier for the column being deleted.
       */
      public String getColumnId() {
        return columnId;
      }

      /** Name or identifier for the column being deleted. */
      public Delete setColumnId(String columnId) {
        this.columnId = columnId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Query collection.
   *
   * The typical use is:<pre>
   *   {@code Fusiontables fusiontables = new Fusiontables(...);}
   *   {@code Fusiontables.Query.List request = fusiontables.query().list(parameters ...)}</pre>
   *
   * @return the resource collection
   */
  public Query query() {
    return new Query();
  }

  /**
   * The "query" collection of methods.
   */
  public class Query {

    /**
     * Executes an SQL SELECT/SHOW/DESCRIBE statement.
     *
     * Create a request for the method "query.sqlGet".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link SqlGet#execute()} method to invoke the remote operation.
     *
     * @param sql An SQL SELECT/SHOW/DESCRIBE statement.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public SqlGet sqlGet(String sql) throws IOException {
      SqlGet result = new SqlGet(sql);
      initialize(result);
      return result;
    }

    public class SqlGet extends FusiontablesRequest {

      private static final String REST_PATH = "query";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      SqlGet(String sql) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.sql = Preconditions.checkNotNull(sql, "Required parameter sql must be specified.");
      }

      /**
       * Sends the "sqlGet" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Sqlresponse} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Sqlresponse execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Sqlresponse result = response.parseAs(
            com.google.api.services.fusiontables.model.Sqlresponse.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "sqlGet" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Sqlresponse&gt;() {

           public void onSuccess(Sqlresponse content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Sqlresponse> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Sqlresponse.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public SqlGet setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** An SQL SELECT/SHOW/DESCRIBE statement. */
      @com.google.api.client.util.Key
      private String sql;

      /** An SQL SELECT/SHOW/DESCRIBE statement.
       */
      public String getSql() {
        return sql;
      }

      /** An SQL SELECT/SHOW/DESCRIBE statement. */
      public SqlGet setSql(String sql) {
        this.sql = sql;
        return this;
      }

      /**
     * Should typed values be returned in the (JSON) response -- numbers for numeric values and
     * parsed geometries for KML values? Default is true.
     */
      @com.google.api.client.util.Key
      private Boolean typed;

      /** Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed
     geometries for KML values? Default is true.
       */
      public Boolean getTyped() {
        return typed;
      }

      /**
     * Should typed values be returned in the (JSON) response -- numbers for numeric values and
     * parsed geometries for KML values? Default is true.
     */
      public SqlGet setTyped(Boolean typed) {
        this.typed = typed;
        return this;
      }

      /** Should column names be included (in the first row)?. Default is true. */
      @com.google.api.client.util.Key
      private Boolean hdrs;

      /** Should column names be included (in the first row)?. Default is true.
       */
      public Boolean getHdrs() {
        return hdrs;
      }

      /** Should column names be included (in the first row)?. Default is true. */
      public SqlGet setHdrs(Boolean hdrs) {
        this.hdrs = hdrs;
        return this;
      }

    }
    /**
     * Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE statement.
     *
     * Create a request for the method "query.sql".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Sql#execute()} method to invoke the remote operation.
     *
     * @param sql An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Sql sql(String sql) throws IOException {
      Sql result = new Sql(sql);
      initialize(result);
      return result;
    }

    public class Sql extends FusiontablesRequest {

      private static final String REST_PATH = "query";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Sql(String sql) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, null);
        this.sql = Preconditions.checkNotNull(sql, "Required parameter sql must be specified.");
      }

      /**
       * Sends the "sql" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Sqlresponse} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Sqlresponse execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Sqlresponse result = response.parseAs(
            com.google.api.services.fusiontables.model.Sqlresponse.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "sql" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Sqlresponse&gt;() {

           public void onSuccess(Sqlresponse content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Sqlresponse> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Sqlresponse.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Sql setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement. */
      @com.google.api.client.util.Key
      private String sql;

      /** An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement.
       */
      public String getSql() {
        return sql;
      }

      /** An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement. */
      public Sql setSql(String sql) {
        this.sql = sql;
        return this;
      }

      /**
     * Should typed values be returned in the (JSON) response -- numbers for numeric values and
     * parsed geometries for KML values? Default is true.
     */
      @com.google.api.client.util.Key
      private Boolean typed;

      /** Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed
     geometries for KML values? Default is true.
       */
      public Boolean getTyped() {
        return typed;
      }

      /**
     * Should typed values be returned in the (JSON) response -- numbers for numeric values and
     * parsed geometries for KML values? Default is true.
     */
      public Sql setTyped(Boolean typed) {
        this.typed = typed;
        return this;
      }

      /** Should column names be included (in the first row)?. Default is true. */
      @com.google.api.client.util.Key
      private Boolean hdrs;

      /** Should column names be included (in the first row)?. Default is true.
       */
      public Boolean getHdrs() {
        return hdrs;
      }

      /** Should column names be included (in the first row)?. Default is true. */
      public Sql setHdrs(Boolean hdrs) {
        this.hdrs = hdrs;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Template collection.
   *
   * The typical use is:<pre>
   *   {@code Fusiontables fusiontables = new Fusiontables(...);}
   *   {@code Fusiontables.Template.List request = fusiontables.template().list(parameters ...)}</pre>
   *
   * @return the resource collection
   */
  public Template template() {
    return new Template();
  }

  /**
   * The "template" collection of methods.
   */
  public class Template {

    /**
     * Creates a new template for the table.
     *
     * Create a request for the method "template.insert".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param tableId Table for which a new template is being created
     * @param content the {@link com.google.api.services.fusiontables.model.Template}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Insert insert(String tableId, com.google.api.services.fusiontables.model.Template content) throws IOException {
      Insert result = new Insert(tableId, content);
      initialize(result);
      return result;
    }

    public class Insert extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/templates";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Insert(String tableId, com.google.api.services.fusiontables.model.Template content) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "insert" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Template} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Template execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Template result = response.parseAs(
            com.google.api.services.fusiontables.model.Template.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "insert" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Template&gt;() {

           public void onSuccess(Template content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Template> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Template.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Insert setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table for which a new template is being created */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table for which a new template is being created
       */
      public String getTableId() {
        return tableId;
      }

      /** Table for which a new template is being created */
      public Insert setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

    }
    /**
     * Retrieves a specific template by its id
     *
     * Create a request for the method "template.get".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param tableId Table to which the template belongs
     * @param templateId Identifier for the template that is being requested
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Get get(String tableId, Integer templateId) throws IOException {
      Get result = new Get(tableId, templateId);
      initialize(result);
      return result;
    }

    public class Get extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/templates/{templateId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Get(String tableId, Integer templateId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.templateId = Preconditions.checkNotNull(templateId, "Required parameter templateId must be specified.");
      }

      /**
       * Sends the "get" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Template} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Template execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Template result = response.parseAs(
            com.google.api.services.fusiontables.model.Template.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "get" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Template&gt;() {

           public void onSuccess(Template content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Template> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Template.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Get setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table to which the template belongs */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table to which the template belongs
       */
      public String getTableId() {
        return tableId;
      }

      /** Table to which the template belongs */
      public Get setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier for the template that is being requested */
      @com.google.api.client.util.Key
      private Integer templateId;

      /** Identifier for the template that is being requested
       */
      public Integer getTemplateId() {
        return templateId;
      }

      /** Identifier for the template that is being requested */
      public Get setTemplateId(Integer templateId) {
        this.templateId = templateId;
        return this;
      }

    }
    /**
     * Retrieves a list of templates.
     *
     * Create a request for the method "template.list".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param tableId Identifier for the table whose templates are being requested
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public List list(String tableId) throws IOException {
      List result = new List(tableId);
      initialize(result);
      return result;
    }

    public class List extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/templates";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      List(String tableId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Sends the "list" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.TemplateList} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.TemplateList execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.TemplateList result = response.parseAs(
            com.google.api.services.fusiontables.model.TemplateList.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "list" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;TemplateList&gt;() {

           public void onSuccess(TemplateList content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.TemplateList> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.TemplateList.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public List setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Identifier for the table whose templates are being requested */
      @com.google.api.client.util.Key
      private String tableId;

      /** Identifier for the table whose templates are being requested
       */
      public String getTableId() {
        return tableId;
      }

      /** Identifier for the table whose templates are being requested */
      public List setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Continuation token specifying which results page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Continuation token specifying which results page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Continuation token specifying which results page to return. Optional. */
      public List setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /** Maximum number of templates to return. Optional. Default is 5. */
      @com.google.api.client.util.Key
      private Long maxResults;

      /** Maximum number of templates to return. Optional. Default is 5.

     [minimum: 0]
       */
      public Long getMaxResults() {
        return maxResults;
      }

      /** Maximum number of templates to return. Optional. Default is 5. */
      public List setMaxResults(Long maxResults) {
        this.maxResults = maxResults;
        return this;
      }

    }
    /**
     * Updates an existing template
     *
     * Create a request for the method "template.update".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param tableId Table to which the updated template belongs
     * @param templateId Identifier for the template that is being updated
     * @param content the {@link com.google.api.services.fusiontables.model.Template}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Update update(String tableId, Integer templateId, com.google.api.services.fusiontables.model.Template content) throws IOException {
      Update result = new Update(tableId, templateId, content);
      initialize(result);
      return result;
    }

    public class Update extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/templates/{templateId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Update(String tableId, Integer templateId, com.google.api.services.fusiontables.model.Template content) {
        super(Fusiontables.this, HttpMethod.PUT, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.templateId = Preconditions.checkNotNull(templateId, "Required parameter templateId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "update" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Template} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Template execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Template result = response.parseAs(
            com.google.api.services.fusiontables.model.Template.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "update" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Template&gt;() {

           public void onSuccess(Template content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Template> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Template.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Update setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table to which the updated template belongs */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table to which the updated template belongs
       */
      public String getTableId() {
        return tableId;
      }

      /** Table to which the updated template belongs */
      public Update setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier for the template that is being updated */
      @com.google.api.client.util.Key
      private Integer templateId;

      /** Identifier for the template that is being updated
       */
      public Integer getTemplateId() {
        return templateId;
      }

      /** Identifier for the template that is being updated */
      public Update setTemplateId(Integer templateId) {
        this.templateId = templateId;
        return this;
      }

    }
    /**
     * Updates an existing template. This method supports patch semantics.
     *
     * Create a request for the method "template.patch".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param tableId Table to which the updated template belongs
     * @param templateId Identifier for the template that is being updated
     * @param content the {@link com.google.api.services.fusiontables.model.Template}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Patch patch(String tableId, Integer templateId, com.google.api.services.fusiontables.model.Template content) throws IOException {
      Patch result = new Patch(tableId, templateId, content);
      initialize(result);
      return result;
    }

    public class Patch extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/templates/{templateId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Patch(String tableId, Integer templateId, com.google.api.services.fusiontables.model.Template content) {
        super(Fusiontables.this, HttpMethod.PATCH, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.templateId = Preconditions.checkNotNull(templateId, "Required parameter templateId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "patch" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Template} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Template execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Template result = response.parseAs(
            com.google.api.services.fusiontables.model.Template.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "patch" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Template&gt;() {

           public void onSuccess(Template content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Template> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Template.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Patch setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table to which the updated template belongs */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table to which the updated template belongs
       */
      public String getTableId() {
        return tableId;
      }

      /** Table to which the updated template belongs */
      public Patch setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier for the template that is being updated */
      @com.google.api.client.util.Key
      private Integer templateId;

      /** Identifier for the template that is being updated
       */
      public Integer getTemplateId() {
        return templateId;
      }

      /** Identifier for the template that is being updated */
      public Patch setTemplateId(Integer templateId) {
        this.templateId = templateId;
        return this;
      }

    }
    /**
     * Deletes a template
     *
     * Create a request for the method "template.delete".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param tableId Table from which the template is being deleted
     * @param templateId Identifier for the template which is being deleted
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Delete delete(String tableId, Integer templateId) throws IOException {
      Delete result = new Delete(tableId, templateId);
      initialize(result);
      return result;
    }

    public class Delete extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/templates/{templateId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Delete(String tableId, Integer templateId) {
        super(Fusiontables.this, HttpMethod.DELETE, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.templateId = Preconditions.checkNotNull(templateId, "Required parameter templateId must be specified.");
      }

      /**
       * Sends the "delete" request to the Fusiontables server.
       *
       * @throws IOException if the request fails
       */
      public void execute() throws IOException {
        HttpResponse response = executeUnparsed();
        response.ignore();
      }

      /**
       * Queues the "delete" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Void&gt;() {

           public void onSuccess(Void content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<Void> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), Void.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Delete setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Table from which the template is being deleted */
      @com.google.api.client.util.Key
      private String tableId;

      /** Table from which the template is being deleted
       */
      public String getTableId() {
        return tableId;
      }

      /** Table from which the template is being deleted */
      public Delete setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** Identifier for the template which is being deleted */
      @com.google.api.client.util.Key
      private Integer templateId;

      /** Identifier for the template which is being deleted
       */
      public Integer getTemplateId() {
        return templateId;
      }

      /** Identifier for the template which is being deleted */
      public Delete setTemplateId(Integer templateId) {
        this.templateId = templateId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Table collection.
   *
   * The typical use is:<pre>
   *   {@code Fusiontables fusiontables = new Fusiontables(...);}
   *   {@code Fusiontables.Table.List request = fusiontables.table().list(parameters ...)}</pre>
   *
   * @return the resource collection
   */
  public Table table() {
    return new Table();
  }

  /**
   * The "table" collection of methods.
   */
  public class Table {

    /**
     * Creates a new table.
     *
     * Create a request for the method "table.insert".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param content the {@link com.google.api.services.fusiontables.model.Table}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Insert insert(com.google.api.services.fusiontables.model.Table content) throws IOException {
      Insert result = new Insert(content);
      initialize(result);
      return result;
    }

    public class Insert extends FusiontablesRequest {

      private static final String REST_PATH = "tables";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Insert(com.google.api.services.fusiontables.model.Table content) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, content);
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "insert" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Table} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Table execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Table result = response.parseAs(
            com.google.api.services.fusiontables.model.Table.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "insert" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Table&gt;() {

           public void onSuccess(Table content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Table> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Table.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Insert setFields(String fields) {
        super.setFields(fields);
        return this;
      }

    }
    /**
     * Retrieves a specific table by its id.
     *
     * Create a request for the method "table.get".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param tableId Identifier(ID) for the table being requested.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Get get(String tableId) throws IOException {
      Get result = new Get(tableId);
      initialize(result);
      return result;
    }

    public class Get extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Get(String tableId) {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Sends the "get" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Table} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Table execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Table result = response.parseAs(
            com.google.api.services.fusiontables.model.Table.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "get" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Table&gt;() {

           public void onSuccess(Table content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Table> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Table.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Get setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Identifier(ID) for the table being requested. */
      @com.google.api.client.util.Key
      private String tableId;

      /** Identifier(ID) for the table being requested.
       */
      public String getTableId() {
        return tableId;
      }

      /** Identifier(ID) for the table being requested. */
      public Get setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

    }
    /**
     * Retrieves a list of tables a user owns.
     *
     * Create a request for the method "table.list".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public List list() throws IOException {
      List result = new List();
      initialize(result);
      return result;
    }

    public class List extends FusiontablesRequest {

      private static final String REST_PATH = "tables";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      List() {
        super(Fusiontables.this, HttpMethod.GET, REST_PATH, null);
      }

      /**
       * Sends the "list" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.TableList} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.TableList execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.TableList result = response.parseAs(
            com.google.api.services.fusiontables.model.TableList.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "list" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;TableList&gt;() {

           public void onSuccess(TableList content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.TableList> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.TableList.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public List setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** Continuation token specifying which result page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Continuation token specifying which result page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Continuation token specifying which result page to return. Optional. */
      public List setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /** Maximum number of styles to return. Optional. Default is 5. */
      @com.google.api.client.util.Key
      private Long maxResults;

      /** Maximum number of styles to return. Optional. Default is 5.

     [minimum: 0]
       */
      public Long getMaxResults() {
        return maxResults;
      }

      /** Maximum number of styles to return. Optional. Default is 5. */
      public List setMaxResults(Long maxResults) {
        this.maxResults = maxResults;
        return this;
      }

    }
    /**
     * Updates an existing table. Unless explicitly requested, only the name, description, and
     * attribution will be updated.
     *
     * Create a request for the method "table.update".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param tableId ID of the table that is being updated.
     * @param content the {@link com.google.api.services.fusiontables.model.Table}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Update update(String tableId, com.google.api.services.fusiontables.model.Table content) throws IOException {
      Update result = new Update(tableId, content);
      initialize(result);
      return result;
    }

    public class Update extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Update(String tableId, com.google.api.services.fusiontables.model.Table content) {
        super(Fusiontables.this, HttpMethod.PUT, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "update" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Table} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Table execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Table result = response.parseAs(
            com.google.api.services.fusiontables.model.Table.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "update" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Table&gt;() {

           public void onSuccess(Table content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Table> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Table.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Update setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** ID of the table that is being updated. */
      @com.google.api.client.util.Key
      private String tableId;

      /** ID of the table that is being updated.
       */
      public String getTableId() {
        return tableId;
      }

      /** ID of the table that is being updated. */
      public Update setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /**
     * Should the view definition also be updated? The specified view definition replaces the
     * existing one. Only a view can be updated with a new definition.
     */
      @com.google.api.client.util.Key
      private Boolean replaceViewDefinition;

      /** Should the view definition also be updated? The specified view definition replaces the existing
     one. Only a view can be updated with a new definition.
       */
      public Boolean getReplaceViewDefinition() {
        return replaceViewDefinition;
      }

      /**
     * Should the view definition also be updated? The specified view definition replaces the
     * existing one. Only a view can be updated with a new definition.
     */
      public Update setReplaceViewDefinition(Boolean replaceViewDefinition) {
        this.replaceViewDefinition = replaceViewDefinition;
        return this;
      }

    }
    /**
     * Updates an existing table. Unless explicitly requested, only the name, description, and
     * attribution will be updated. This method supports patch semantics.
     *
     * Create a request for the method "table.patch".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param tableId ID of the table that is being updated.
     * @param content the {@link com.google.api.services.fusiontables.model.Table}
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Patch patch(String tableId, com.google.api.services.fusiontables.model.Table content) throws IOException {
      Patch result = new Patch(tableId, content);
      initialize(result);
      return result;
    }

    public class Patch extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Patch(String tableId, com.google.api.services.fusiontables.model.Table content) {
        super(Fusiontables.this, HttpMethod.PATCH, REST_PATH, content);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        Preconditions.checkNotNull(content);
      }

      /**
       * Sends the "patch" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Table} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Table execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Table result = response.parseAs(
            com.google.api.services.fusiontables.model.Table.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "patch" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Table&gt;() {

           public void onSuccess(Table content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Table> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Table.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Patch setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** ID of the table that is being updated. */
      @com.google.api.client.util.Key
      private String tableId;

      /** ID of the table that is being updated.
       */
      public String getTableId() {
        return tableId;
      }

      /** ID of the table that is being updated. */
      public Patch setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /**
     * Should the view definition also be updated? The specified view definition replaces the
     * existing one. Only a view can be updated with a new definition.
     */
      @com.google.api.client.util.Key
      private Boolean replaceViewDefinition;

      /** Should the view definition also be updated? The specified view definition replaces the existing
     one. Only a view can be updated with a new definition.
       */
      public Boolean getReplaceViewDefinition() {
        return replaceViewDefinition;
      }

      /**
     * Should the view definition also be updated? The specified view definition replaces the
     * existing one. Only a view can be updated with a new definition.
     */
      public Patch setReplaceViewDefinition(Boolean replaceViewDefinition) {
        this.replaceViewDefinition = replaceViewDefinition;
        return this;
      }

    }
    /**
     * Copies a table.
     *
     * Create a request for the method "table.copy".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Copy#execute()} method to invoke the remote operation.
     *
     * @param tableId ID of the table that is being copied.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Copy copy(String tableId) throws IOException {
      Copy result = new Copy(tableId);
      initialize(result);
      return result;
    }

    public class Copy extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/copy";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Copy(String tableId) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Sends the "copy" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.Table} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.Table execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.Table result = response.parseAs(
            com.google.api.services.fusiontables.model.Table.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "copy" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Table&gt;() {

           public void onSuccess(Table content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.Table> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.Table.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Copy setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** ID of the table that is being copied. */
      @com.google.api.client.util.Key
      private String tableId;

      /** ID of the table that is being copied.
       */
      public String getTableId() {
        return tableId;
      }

      /** ID of the table that is being copied. */
      public Copy setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

    }
    /**
     * Deletes a table.
     *
     * Create a request for the method "table.delete".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param tableId ID of the table that is being deleted.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Delete delete(String tableId) throws IOException {
      Delete result = new Delete(tableId);
      initialize(result);
      return result;
    }

    public class Delete extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Delete(String tableId) {
        super(Fusiontables.this, HttpMethod.DELETE, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Sends the "delete" request to the Fusiontables server.
       *
       * @throws IOException if the request fails
       */
      public void execute() throws IOException {
        HttpResponse response = executeUnparsed();
        response.ignore();
      }

      /**
       * Queues the "delete" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;Void&gt;() {

           public void onSuccess(Void content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<Void> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), Void.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Delete setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** ID of the table that is being deleted. */
      @com.google.api.client.util.Key
      private String tableId;

      /** ID of the table that is being deleted.
       */
      public String getTableId() {
        return tableId;
      }

      /** ID of the table that is being deleted. */
      public Delete setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the FusiontablesImport collection.
   *
   * The typical use is:<pre>
   *   {@code Fusiontables fusiontables = new Fusiontables(...);}
   *   {@code Fusiontables.FusiontablesImport.List request = fusiontables.fusiontablesImport().list(parameters ...)}</pre>
   *
   * @return the resource collection
   */
  public FusiontablesImport fusiontablesImport() {
    return new FusiontablesImport();
  }

  /**
   * The "import" collection of methods.
   */
  public class FusiontablesImport {

    /**
     * Import more rows into a table.
     *
     * Create a request for the method "import.insert".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param tableId The table into which new rows are being imported.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Insert insert(String tableId) throws IOException {
      Insert result = new Insert(tableId);
      initialize(result);
      return result;
    }

    /**
     * Import more rows into a table.
     *
     * Create a request for the method "import.insert".
     *
     * This request holds the parameters needed by the the fusiontables server.  After setting any
     * optional parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * <p>
     * This method should be used for uploading media content.
     * </p>
     *
     * @param tableId The table into which new rows are being imported.
     * @param mediaContent The media HTTP content or {@code null} if none.
     * @return the request
     * @throws IOException if the initialization of the request fails
     */
    public Insert insert(String tableId,
        com.google.api.client.http.AbstractInputStreamContent mediaContent) throws IOException {
      Insert result = new Insert(tableId, mediaContent);
      initialize(result);
      return result;
    }

    public class Insert extends FusiontablesRequest {

      private static final String REST_PATH = "tables/{tableId}/import";

      /**
       * Internal constructor.  Use the convenience method instead.
       */
      Insert(String tableId) {
        super(Fusiontables.this, HttpMethod.POST, REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
      }

      /**
       * Internal constructor for media upload.  Use the convenience method instead.
       */
      Insert(String tableId,
          com.google.api.client.http.AbstractInputStreamContent mediaContent) {
        super(Fusiontables.this, HttpMethod.POST,
            "/upload" + new GenericUrl(getBaseUrl()).getRawPath() + REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.uploader =
          new com.google.api.client.googleapis.media.MediaHttpUploader(mediaContent,
            getRequestFactory().getTransport(), getRequestFactory().getInitializer());
        this.uploader.setInitiationMethod(HttpMethod.POST);
      }
      @Override
      public HttpResponse executeUnparsed() throws IOException {
        if (this.uploader == null) {
          return super.executeUnparsed();
        }
        HttpResponse response = uploader.upload(buildHttpRequestUrl());
        if (!response.isSuccessStatusCode()) {
          throw com.google.api.client.googleapis.json.GoogleJsonResponseException.from(
              getJsonFactory(), response);
        }
        return response;
      }

      @Override
      public HttpRequest buildHttpRequest() throws IOException {
        if (this.uploader == null) {
          return super.buildHttpRequest();
        }
        throw new UnsupportedOperationException();
      }
      /**
       * Sends the "insert" request to the Fusiontables server.
       *
       * @return the {@link com.google.api.services.fusiontables.model.FusiontablesImport} response
       * @throws IOException if the request fails
       */
      public com.google.api.services.fusiontables.model.FusiontablesImport execute() throws IOException {
        HttpResponse response = executeUnparsed();
        com.google.api.services.fusiontables.model.FusiontablesImport result = Fusiontables.this.getJsonHttpParser().parse(response,
            com.google.api.services.fusiontables.model.FusiontablesImport.class);
        result.setResponseHeaders(response.getHeaders());
        return result;
      }

      /**
       * Queues the "insert" request to the Fusiontables server into the given batch request.
       *
       * <p>
       * Example usage:
       * </p>
       *
       * <pre>
         request.queue(batchRequest, new JsonBatchCallback&lt;FusiontablesImport&gt;() {

           public void onSuccess(FusiontablesImport content, GoogleHeaders responseHeaders) {
             log("Success");
           }

           public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {
             log(e.getMessage());
           }
         });
       * </pre>
       *
       * @param batch a single batch of requests
       * @param callback batch callback
       * @since 1.6
       */
      public void queue(com.google.api.client.googleapis.batch.BatchRequest batch,
          com.google.api.client.googleapis.batch.json.JsonBatchCallback<com.google.api.services.fusiontables.model.FusiontablesImport> callback)
          throws IOException {
        batch.queue(buildHttpRequest(), com.google.api.services.fusiontables.model.FusiontablesImport.class,
            com.google.api.client.googleapis.json.GoogleJsonErrorContainer.class, callback);
      }

      /**
       * @since 1.7
       */
      @Override
      public Insert setFields(String fields) {
        super.setFields(fields);
        return this;
      }

      /** The table into which new rows are being imported. */
      @com.google.api.client.util.Key
      private String tableId;

      /** The table into which new rows are being imported.
       */
      public String getTableId() {
        return tableId;
      }

      /** The table into which new rows are being imported. */
      public Insert setTableId(String tableId) {
        this.tableId = tableId;
        return this;
      }

      /** The index of the first line from which to start importing, inclusive. Default is 0. */
      @com.google.api.client.util.Key
      private Long startLine;

      /** The index of the first line from which to start importing, inclusive. Default is 0.
       */
      public Long getStartLine() {
        return startLine;
      }

      /** The index of the first line from which to start importing, inclusive. Default is 0. */
      public Insert setStartLine(Long startLine) {
        this.startLine = startLine;
        return this;
      }

      /** Whether the CSV will be parsed strictly or not. Default is true. */
      @com.google.api.client.util.Key
      private Boolean isStrict;

      /** Whether the CSV will be parsed strictly or not. Default is true.
       */
      public Boolean getIsStrict() {
        return isStrict;
      }

      /** Whether the CSV will be parsed strictly or not. Default is true. */
      public Insert setIsStrict(Boolean isStrict) {
        this.isStrict = isStrict;
        return this;
      }

      /** The encoding of the content. Default is UTF-8. */
      @com.google.api.client.util.Key
      private String encoding;

      /** The encoding of the content. Default is UTF-8.
       */
      public String getEncoding() {
        return encoding;
      }

      /** The encoding of the content. Default is UTF-8. */
      public Insert setEncoding(String encoding) {
        this.encoding = encoding;
        return this;
      }

      /** The delimiter used to separate cell values. Default is ','. */
      @com.google.api.client.util.Key
      private String delimiter;

      /** The delimiter used to separate cell values. Default is ','.
       */
      public String getDelimiter() {
        return delimiter;
      }

      /** The delimiter used to separate cell values. Default is ','. */
      public Insert setDelimiter(String delimiter) {
        this.delimiter = delimiter;
        return this;
      }

      /**
     * The index of the last line from which to start importing, exclusive. Thus, the number of
     * imported lines is endLine - startLine. If this parameter is not provided, the file will be
     * imported until the last line of the file. If endLine is negative, then it is equivalent to N
     * + endLine, where N is the number of lines in the file.
     */
      @com.google.api.client.util.Key
      private Long endLine;

      /** The index of the last line from which to start importing, exclusive. Thus, the number of imported
     lines is endLine - startLine. If this parameter is not provided, the file will be imported until
     the last line of the file. If endLine is negative, then it is equivalent to N + endLine, where N is
     the number of lines in the file.
       */
      public Long getEndLine() {
        return endLine;
      }

      /**
     * The index of the last line from which to start importing, exclusive. Thus, the number of
     * imported lines is endLine - startLine. If this parameter is not provided, the file will be
     * imported until the last line of the file. If endLine is negative, then it is equivalent to N
     * + endLine, where N is the number of lines in the file.
     */
      public Insert setEndLine(Long endLine) {
        this.endLine = endLine;
        return this;
      }

      /**
       * Media HTTP uploader or {@code null} if there is no media HTTP content provided to be uploaded.
       */
      private com.google.api.client.googleapis.media.MediaHttpUploader uploader;

      /**
       * Returns the Media HTTP Uploader or {@code null} if there is no media HTTP content provided to
       * be uploaded.
       */
      public com.google.api.client.googleapis.media.MediaHttpUploader getMediaHttpUploader() {
        return uploader;
      }

    }

  }

  /**
   * Builder for {@link Fusiontables}.
   *
   * <p>
   * Implementation is not thread-safe.
   * </p>
   *
   * @since 1.3.0
   */
  public static final class Builder extends GoogleClient.Builder {

    /**
     * Returns an instance of a new builder.
     *
     * @param transport The transport to use for requests
     * @param jsonFactory A factory for creating JSON parsers and serializers
     * @param baseUrl The base URL of the service. Must end with a "/"
     */
    @Deprecated
    Builder(HttpTransport transport, JsonFactory jsonFactory, GenericUrl baseUrl) {
      super(transport, jsonFactory, baseUrl);
    }

    /**
     * Returns an instance of a new builder.
     *
     * @param transport The transport to use for requests
     * @param jsonFactory A factory for creating JSON parsers and serializers
     * @param httpRequestInitializer The HTTP request initializer or {@code null} for none
     * @since 1.7
     */
    public Builder(HttpTransport transport, JsonFactory jsonFactory,
        HttpRequestInitializer httpRequestInitializer) {
      super(transport, jsonFactory, DEFAULT_ROOT_URL, DEFAULT_SERVICE_PATH, httpRequestInitializer);
    }

    /** Builds a new instance of {@link Fusiontables}. */
    @SuppressWarnings("deprecation")
    @Override
    public Fusiontables build() {
      if (isBaseUrlUsed()) {
        return new Fusiontables(
            getTransport(),
            getJsonHttpRequestInitializer(),
            getHttpRequestInitializer(),
            getJsonFactory(),
            getObjectParser(),
            getBaseUrl().build(),
            getApplicationName());
      }
      return new Fusiontables(
          getTransport(),
          getJsonHttpRequestInitializer(),
          getHttpRequestInitializer(),
          getJsonFactory(),
          getObjectParser(),
          getRootUrl(),
          getServicePath(),
          getApplicationName(),
          getSuppressPatternChecks());
    }

    @Override
    @Deprecated
    public Builder setBaseUrl(GenericUrl baseUrl) {
      super.setBaseUrl(baseUrl);
      return this;
    }

    @Override
    public Builder setRootUrl(String rootUrl) {
      super.setRootUrl(rootUrl);
      return this;
    }

    @Override
    public Builder setServicePath(String servicePath) {
      super.setServicePath(servicePath);
      return this;
    }

    @Override
    public Builder setJsonHttpRequestInitializer(
        JsonHttpRequestInitializer jsonHttpRequestInitializer) {
      super.setJsonHttpRequestInitializer(jsonHttpRequestInitializer);
      return this;
    }

    @Override
    public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) {
      super.setHttpRequestInitializer(httpRequestInitializer);
      return this;
    }

    @Override
    public Builder setApplicationName(String applicationName) {
      super.setApplicationName(applicationName);
      return this;
    }

    @Override
    public Builder setObjectParser(JsonObjectParser parser) {
      super.setObjectParser(parser);
      return this;
    }

    @Override
    public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
      super.setSuppressPatternChecks(suppressPatternChecks);
      return this;
    }
  }
}
TOP

Related Classes of com.google.api.services.fusiontables.Fusiontables$Column$Get

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.