blob: 81becb5b44e697dae6ebd6a817b58d507d93c54a [file] [log] [blame]
// Copyright 2019 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package fusiontables provides access to the Fusion Tables API.
//
// See https://developers.google.com/fusiontables
//
// Usage example:
//
// import "google.golang.org/api/fusiontables/v2"
// ...
// fusiontablesService, err := fusiontables.New(oauthHttpClient)
package fusiontables // import "google.golang.org/api/fusiontables/v2"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "fusiontables:v2"
const apiName = "fusiontables"
const apiVersion = "v2"
const basePath = "https://www.googleapis.com/fusiontables/v2/"
// OAuth2 scopes used by this API.
const (
// Manage your Fusion Tables
FusiontablesScope = "https://www.googleapis.com/auth/fusiontables"
// View your Fusion Tables
FusiontablesReadonlyScope = "https://www.googleapis.com/auth/fusiontables.readonly"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Column = NewColumnService(s)
s.Query = NewQueryService(s)
s.Style = NewStyleService(s)
s.Table = NewTableService(s)
s.Task = NewTaskService(s)
s.Template = NewTemplateService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Column *ColumnService
Query *QueryService
Style *StyleService
Table *TableService
Task *TaskService
Template *TemplateService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewColumnService(s *Service) *ColumnService {
rs := &ColumnService{s: s}
return rs
}
type ColumnService struct {
s *Service
}
func NewQueryService(s *Service) *QueryService {
rs := &QueryService{s: s}
return rs
}
type QueryService struct {
s *Service
}
func NewStyleService(s *Service) *StyleService {
rs := &StyleService{s: s}
return rs
}
type StyleService struct {
s *Service
}
func NewTableService(s *Service) *TableService {
rs := &TableService{s: s}
return rs
}
type TableService struct {
s *Service
}
func NewTaskService(s *Service) *TaskService {
rs := &TaskService{s: s}
return rs
}
type TaskService struct {
s *Service
}
func NewTemplateService(s *Service) *TemplateService {
rs := &TemplateService{s: s}
return rs
}
type TemplateService struct {
s *Service
}
// Bucket: Specifies the minimum and maximum values, the color, opacity,
// icon and weight of a bucket within a StyleSetting.
type Bucket struct {
// Color: Color of line or the interior of a polygon in #RRGGBB format.
Color string `json:"color,omitempty"`
// Icon: Icon name used for a point.
Icon string `json:"icon,omitempty"`
// Max: Maximum value in the selected column for a row to be styled
// according to the bucket color, opacity, icon, or weight.
Max float64 `json:"max,omitempty"`
// Min: Minimum value in the selected column for a row to be styled
// according to the bucket color, opacity, icon, or weight.
Min float64 `json:"min,omitempty"`
// Opacity: Opacity of the color: 0.0 (transparent) to 1.0 (opaque).
Opacity float64 `json:"opacity,omitempty"`
// Weight: Width of a line (in pixels).
Weight int64 `json:"weight,omitempty"`
// ForceSendFields is a list of field names (e.g. "Color") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Color") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Bucket) MarshalJSON() ([]byte, error) {
type NoMethod Bucket
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *Bucket) UnmarshalJSON(data []byte) error {
type NoMethod Bucket
var s1 struct {
Max gensupport.JSONFloat64 `json:"max"`
Min gensupport.JSONFloat64 `json:"min"`
Opacity gensupport.JSONFloat64 `json:"opacity"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Max = float64(s1.Max)
s.Min = float64(s1.Min)
s.Opacity = float64(s1.Opacity)
return nil
}
// Column: Specifies the details of a column in a table.
type Column struct {
// BaseColumn: Identifier of the base column. If present, this column is
// derived from the specified base column.
BaseColumn *ColumnBaseColumn `json:"baseColumn,omitempty"`
// ColumnId: Identifier for the column.
ColumnId int64 `json:"columnId,omitempty"`
// ColumnJsonSchema: JSON schema for interpreting JSON in this column.
ColumnJsonSchema string `json:"columnJsonSchema,omitempty"`
// ColumnPropertiesJson: JSON object containing custom column
// properties.
ColumnPropertiesJson string `json:"columnPropertiesJson,omitempty"`
// Description: Column description.
Description string `json:"description,omitempty"`
// FormatPattern: Format pattern.
// Acceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 DT_DATE_SHORTfor
// example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, 2008 8:30:45
// PM DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM
// DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08
// DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30
// DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM
// DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008
// DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor example 24/12/2008 20:30
// DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM
// DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24
// DT_ISO_YEAR_MONTH_DAY_TIMEfor example 2008-12-24 20:30:45
// DT_MONTH_DAY_4_DIGIT_YEARfor example 12/24/2008 DT_TIME_LONGfor
// example 8:30:45 PM UTC-6 DT_TIME_MEDIUMfor example 8:30:45 PM
// DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor example 2008
// HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does not match the
// data type NONENo formatting (default) NUMBER_CURRENCYfor example
// $1234.56 NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor example
// 1235 NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor example
// 123,456% NUMBER_SCIENTIFICfor example 1E3
// STRING_EIGHT_LINE_IMAGEDisplays thumbnail images as tall as eight
// lines of text STRING_FOUR_LINE_IMAGEDisplays thumbnail images as tall
// as four lines of text STRING_JSON_TEXTAllows editing of text as JSON
// in UI STRING_JSON_LISTAllows editing of text as a JSON list in UI
// STRING_LINKTreats cell as a link (must start with http:// or
// https://) STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as
// one line of text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail
FormatPattern string `json:"formatPattern,omitempty"`
// GraphPredicate: Column graph predicate.
// Used to map table to graph data model (subject,predicate,object)
// See W3C Graph-based Data Model.
GraphPredicate string `json:"graphPredicate,omitempty"`
// Kind: The kind of item this is. For a column, this is always
// fusiontables#column.
Kind string `json:"kind,omitempty"`
// Name: Name of the column.
Name string `json:"name,omitempty"`
// Type: Type of the column.
Type string `json:"type,omitempty"`
// ValidValues: List of valid values used to validate data and supply a
// drop-down list of values in the web application.
ValidValues []string `json:"validValues,omitempty"`
// ValidateData: If true, data entered via the web application is
// validated.
ValidateData bool `json:"validateData,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BaseColumn") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BaseColumn") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Column) MarshalJSON() ([]byte, error) {
type NoMethod Column
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ColumnBaseColumn: Identifier of the base column. If present, this
// column is derived from the specified base column.
type ColumnBaseColumn struct {
// ColumnId: The id of the column in the base table from which this
// column is derived.
ColumnId int64 `json:"columnId,omitempty"`
// TableIndex: Offset to the entry in the list of base tables in the
// table definition.
TableIndex int64 `json:"tableIndex,omitempty"`
// ForceSendFields is a list of field names (e.g. "ColumnId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ColumnId") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ColumnBaseColumn) MarshalJSON() ([]byte, error) {
type NoMethod ColumnBaseColumn
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ColumnList: Represents a list of columns in a table.
type ColumnList struct {
// Items: List of all requested columns.
Items []*Column `json:"items,omitempty"`
// Kind: The kind of item this is. For a column list, this is always
// fusiontables#columnList.
Kind string `json:"kind,omitempty"`
// NextPageToken: Token used to access the next page of this result. No
// token is displayed if there are no more pages left.
NextPageToken string `json:"nextPageToken,omitempty"`
// TotalItems: Total number of columns for the table.
TotalItems int64 `json:"totalItems,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ColumnList) MarshalJSON() ([]byte, error) {
type NoMethod ColumnList
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Geometry: Represents a Geometry object.
type Geometry struct {
// Geometries: The list of geometries in this geometry collection.
Geometries []interface{} `json:"geometries,omitempty"`
Geometry interface{} `json:"geometry,omitempty"`
// Type: Type: A collection of geometries.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Geometries") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Geometries") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Geometry) MarshalJSON() ([]byte, error) {
type NoMethod Geometry
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Import: Represents an import request.
type Import struct {
// Kind: The kind of item this is. For an import, this is always
// fusiontables#import.
Kind string `json:"kind,omitempty"`
// NumRowsReceived: The number of rows received from the import request.
NumRowsReceived int64 `json:"numRowsReceived,omitempty,string"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Import) MarshalJSON() ([]byte, error) {
type NoMethod Import
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Line: Represents a line geometry.
type Line struct {
// Coordinates: The coordinates that define the line.
Coordinates [][]float64 `json:"coordinates,omitempty"`
// Type: Type: A line geometry.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Coordinates") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Coordinates") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Line) MarshalJSON() ([]byte, error) {
type NoMethod Line
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LineStyle: Represents a LineStyle within a StyleSetting
type LineStyle struct {
// StrokeColor: Color of the line in #RRGGBB format.
StrokeColor string `json:"strokeColor,omitempty"`
// StrokeColorStyler: Column-value, gradient or buckets styler that is
// used to determine the line color and opacity.
StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"`
// StrokeOpacity: Opacity of the line : 0.0 (transparent) to 1.0
// (opaque).
StrokeOpacity float64 `json:"strokeOpacity,omitempty"`
// StrokeWeight: Width of the line in pixels.
StrokeWeight int64 `json:"strokeWeight,omitempty"`
// StrokeWeightStyler: Column-value or bucket styler that is used to
// determine the width of the line.
StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"`
// ForceSendFields is a list of field names (e.g. "StrokeColor") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "StrokeColor") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *LineStyle) MarshalJSON() ([]byte, error) {
type NoMethod LineStyle
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *LineStyle) UnmarshalJSON(data []byte) error {
type NoMethod LineStyle
var s1 struct {
StrokeOpacity gensupport.JSONFloat64 `json:"strokeOpacity"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.StrokeOpacity = float64(s1.StrokeOpacity)
return nil
}
// Point: Represents a point object.
type Point struct {
// Coordinates: The coordinates that define the point.
Coordinates []float64 `json:"coordinates,omitempty"`
// Type: Point: A point geometry.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Coordinates") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Coordinates") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Point) MarshalJSON() ([]byte, error) {
type NoMethod Point
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PointStyle: Represents a PointStyle within a StyleSetting
type PointStyle struct {
// IconName: Name of the icon. Use values defined in
// http://www.google.com/fusiontables/DataSource?dsrcid=308519
IconName string `json:"iconName,omitempty"`
// IconStyler: Column or a bucket value from which the icon name is to
// be determined.
IconStyler *StyleFunction `json:"iconStyler,omitempty"`
// ForceSendFields is a list of field names (e.g. "IconName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IconName") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PointStyle) MarshalJSON() ([]byte, error) {
type NoMethod PointStyle
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Polygon: Represents a polygon object.
type Polygon struct {
// Coordinates: The coordinates that define the polygon.
Coordinates [][][]float64 `json:"coordinates,omitempty"`
// Type: Type: A polygon geometry.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Coordinates") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Coordinates") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Polygon) MarshalJSON() ([]byte, error) {
type NoMethod Polygon
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PolygonStyle: Represents a PolygonStyle within a StyleSetting
type PolygonStyle struct {
// FillColor: Color of the interior of the polygon in #RRGGBB format.
FillColor string `json:"fillColor,omitempty"`
// FillColorStyler: Column-value, gradient, or bucket styler that is
// used to determine the interior color and opacity of the polygon.
FillColorStyler *StyleFunction `json:"fillColorStyler,omitempty"`
// FillOpacity: Opacity of the interior of the polygon: 0.0
// (transparent) to 1.0 (opaque).
FillOpacity float64 `json:"fillOpacity,omitempty"`
// StrokeColor: Color of the polygon border in #RRGGBB format.
StrokeColor string `json:"strokeColor,omitempty"`
// StrokeColorStyler: Column-value, gradient or buckets styler that is
// used to determine the border color and opacity.
StrokeColorStyler *StyleFunction `json:"strokeColorStyler,omitempty"`
// StrokeOpacity: Opacity of the polygon border: 0.0 (transparent) to
// 1.0 (opaque).
StrokeOpacity float64 `json:"strokeOpacity,omitempty"`
// StrokeWeight: Width of the polyon border in pixels.
StrokeWeight int64 `json:"strokeWeight,omitempty"`
// StrokeWeightStyler: Column-value or bucket styler that is used to
// determine the width of the polygon border.
StrokeWeightStyler *StyleFunction `json:"strokeWeightStyler,omitempty"`
// ForceSendFields is a list of field names (e.g. "FillColor") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FillColor") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PolygonStyle) MarshalJSON() ([]byte, error) {
type NoMethod PolygonStyle
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *PolygonStyle) UnmarshalJSON(data []byte) error {
type NoMethod PolygonStyle
var s1 struct {
FillOpacity gensupport.JSONFloat64 `json:"fillOpacity"`
StrokeOpacity gensupport.JSONFloat64 `json:"strokeOpacity"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.FillOpacity = float64(s1.FillOpacity)
s.StrokeOpacity = float64(s1.StrokeOpacity)
return nil
}
// Sqlresponse: Represents a response to a SQL statement.
type Sqlresponse struct {
// Columns: Columns in the table.
Columns []string `json:"columns,omitempty"`
// Kind: The kind of item this is. For responses to SQL queries, this is
// always fusiontables#sqlresponse.
Kind string `json:"kind,omitempty"`
// Rows: The rows in the table. For each cell we print out whatever cell
// value (e.g., numeric, string) exists. Thus it is important that each
// cell contains only one value.
Rows [][]interface{} `json:"rows,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Columns") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Columns") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Sqlresponse) MarshalJSON() ([]byte, error) {
type NoMethod Sqlresponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// StyleFunction: Represents a StyleFunction within a StyleSetting
type StyleFunction struct {
// Buckets: Bucket function that assigns a style based on the range a
// column value falls into.
Buckets []*Bucket `json:"buckets,omitempty"`
// ColumnName: Name of the column whose value is used in the style.
ColumnName string `json:"columnName,omitempty"`
// Gradient: Gradient function that interpolates a range of colors based
// on column value.
Gradient *StyleFunctionGradient `json:"gradient,omitempty"`
// Kind: Stylers can be one of three kinds: "fusiontables#fromColumn if
// the column value is to be used as is, i.e., the column values can
// have colors in #RRGGBBAA format or integer line widths or icon names;
// fusiontables#gradient if the styling of the row is to be based on
// applying the gradient function on the column value; or
// fusiontables#buckets if the styling is to based on the bucket into
// which the the column value falls.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "Buckets") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Buckets") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *StyleFunction) MarshalJSON() ([]byte, error) {
type NoMethod StyleFunction
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// StyleFunctionGradient: Gradient function that interpolates a range of
// colors based on column value.
type StyleFunctionGradient struct {
// Colors: Array with two or more colors.
Colors []*StyleFunctionGradientColors `json:"colors,omitempty"`
// Max: Higher-end of the interpolation range: rows with this value will
// be assigned to colors[n-1].
Max float64 `json:"max,omitempty"`
// Min: Lower-end of the interpolation range: rows with this value will
// be assigned to colors[0].
Min float64 `json:"min,omitempty"`
// ForceSendFields is a list of field names (e.g. "Colors") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Colors") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *StyleFunctionGradient) MarshalJSON() ([]byte, error) {
type NoMethod StyleFunctionGradient
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *StyleFunctionGradient) UnmarshalJSON(data []byte) error {
type NoMethod StyleFunctionGradient
var s1 struct {
Max gensupport.JSONFloat64 `json:"max"`
Min gensupport.JSONFloat64 `json:"min"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Max = float64(s1.Max)
s.Min = float64(s1.Min)
return nil
}
type StyleFunctionGradientColors struct {
// Color: Color in #RRGGBB format.
Color string `json:"color,omitempty"`
// Opacity: Opacity of the color: 0.0 (transparent) to 1.0 (opaque).
Opacity float64 `json:"opacity,omitempty"`
// ForceSendFields is a list of field names (e.g. "Color") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Color") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *StyleFunctionGradientColors) MarshalJSON() ([]byte, error) {
type NoMethod StyleFunctionGradientColors
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *StyleFunctionGradientColors) UnmarshalJSON(data []byte) error {
type NoMethod StyleFunctionGradientColors
var s1 struct {
Opacity gensupport.JSONFloat64 `json:"opacity"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Opacity = float64(s1.Opacity)
return nil
}
// StyleSetting: Represents a complete StyleSettings object. The primary
// key is a combination of the tableId and a styleId.
type StyleSetting struct {
// Kind: The kind of item this is. A StyleSetting contains the style
// definitions for points, lines, and polygons in a table. Since a table
// can have any one or all of them, a style definition can have point,
// line and polygon style definitions.
Kind string `json:"kind,omitempty"`
// MarkerOptions: Style definition for points in the table.
MarkerOptions *PointStyle `json:"markerOptions,omitempty"`
// Name: Optional name for the style setting.
Name string `json:"name,omitempty"`
// PolygonOptions: Style definition for polygons in the table.
PolygonOptions *PolygonStyle `json:"polygonOptions,omitempty"`
// PolylineOptions: Style definition for lines in the table.
PolylineOptions *LineStyle `json:"polylineOptions,omitempty"`
// StyleId: Identifier for the style setting (unique only within
// tables).
StyleId int64 `json:"styleId,omitempty"`
// TableId: Identifier for the table.
TableId string `json:"tableId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *StyleSetting) MarshalJSON() ([]byte, error) {
type NoMethod StyleSetting
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// StyleSettingList: Represents a list of styles for a given table.
type StyleSettingList struct {
// Items: All requested style settings.
Items []*StyleSetting `json:"items,omitempty"`
// Kind: The kind of item this is. For a style list, this is always
// fusiontables#styleSettingList .
Kind string `json:"kind,omitempty"`
// NextPageToken: Token used to access the next page of this result. No
// token is displayed if there are no more styles left.
NextPageToken string `json:"nextPageToken,omitempty"`
// TotalItems: Total number of styles for the table.
TotalItems int64 `json:"totalItems,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *StyleSettingList) MarshalJSON() ([]byte, error) {
type NoMethod StyleSettingList
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Table: Represents a table.
type Table struct {
// Attribution: Attribution assigned to the table.
Attribution string `json:"attribution,omitempty"`
// AttributionLink: Optional link for attribution.
AttributionLink string `json:"attributionLink,omitempty"`
// BaseTableIds: Base table identifier if this table is a view or merged
// table.
BaseTableIds []string `json:"baseTableIds,omitempty"`
// ColumnPropertiesJsonSchema: Default JSON schema for validating all
// JSON column properties.
ColumnPropertiesJsonSchema string `json:"columnPropertiesJsonSchema,omitempty"`
// Columns: Columns in the table.
Columns []*Column `json:"columns,omitempty"`
// Description: Description assigned to the table.
Description string `json:"description,omitempty"`
// IsExportable: Variable for whether table is exportable.
IsExportable bool `json:"isExportable,omitempty"`
// Kind: The kind of item this is. For a table, this is always
// fusiontables#table.
Kind string `json:"kind,omitempty"`
// Name: Name assigned to a table.
Name string `json:"name,omitempty"`
// Sql: SQL that encodes the table definition for derived tables.
Sql string `json:"sql,omitempty"`
// TableId: Encrypted unique alphanumeric identifier for the table.
TableId string `json:"tableId,omitempty"`
// TablePropertiesJson: JSON object containing custom table properties.
TablePropertiesJson string `json:"tablePropertiesJson,omitempty"`
// TablePropertiesJsonSchema: JSON schema for validating the JSON table
// properties.
TablePropertiesJsonSchema string `json:"tablePropertiesJsonSchema,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Attribution") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Attribution") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Table) MarshalJSON() ([]byte, error) {
type NoMethod Table
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TableList: Represents a list of tables.
type TableList struct {
// Items: List of all requested tables.
Items []*Table `json:"items,omitempty"`
// Kind: The kind of item this is. For table list, this is always
// fusiontables#tableList.
Kind string `json:"kind,omitempty"`
// NextPageToken: Token used to access the next page of this result. No
// token is displayed if there are no more pages left.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TableList) MarshalJSON() ([]byte, error) {
type NoMethod TableList
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Task: A background task on a table, initiated for time- or
// resource-consuming operations such as changing column types or
// deleting all rows.
type Task struct {
// Kind: Type of the resource. This is always "fusiontables#task".
Kind string `json:"kind,omitempty"`
// Progress: Task percentage completion.
Progress string `json:"progress,omitempty"`
// Started: false while the table is busy with some other task. true if
// this background task is currently running.
Started bool `json:"started,omitempty"`
// TaskId: Identifier for the task.
TaskId int64 `json:"taskId,omitempty,string"`
// Type: Type of background task.
Type string `json:"type,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Kind") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Task) MarshalJSON() ([]byte, error) {
type NoMethod Task
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TaskList: Represents a list of tasks for a table.
type TaskList struct {
// Items: List of all requested tasks.
Items []*Task `json:"items,omitempty"`
// Kind: Type of the resource. This is always "fusiontables#taskList".
Kind string `json:"kind,omitempty"`
// NextPageToken: Token used to access the next page of this result. No
// token is displayed if there are no more pages left.
NextPageToken string `json:"nextPageToken,omitempty"`
// TotalItems: Total number of tasks for the table.
TotalItems int64 `json:"totalItems,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TaskList) MarshalJSON() ([]byte, error) {
type NoMethod TaskList
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Template: Represents the contents of InfoWindow templates.
type Template struct {
// AutomaticColumnNames: List of columns from which the template is to
// be automatically constructed. Only one of body or automaticColumns
// can be specified.
AutomaticColumnNames []string `json:"automaticColumnNames,omitempty"`
// Body: Body of the template. It contains HTML with {column_name} to
// insert values from a particular column. The body is sanitized to
// remove certain tags, e.g., script. Only one of body or
// automaticColumns can be specified.
Body string `json:"body,omitempty"`
// Kind: The kind of item this is. For a template, this is always
// fusiontables#template.
Kind string `json:"kind,omitempty"`
// Name: Optional name assigned to a template.
Name string `json:"name,omitempty"`
// TableId: Identifier for the table for which the template is defined.
TableId string `json:"tableId,omitempty"`
// TemplateId: Identifier for the template, unique within the context of
// a particular table.
TemplateId int64 `json:"templateId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "AutomaticColumnNames") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AutomaticColumnNames") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *Template) MarshalJSON() ([]byte, error) {
type NoMethod Template
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TemplateList: Represents a list of templates for a given table.
type TemplateList struct {
// Items: List of all requested templates.
Items []*Template `json:"items,omitempty"`
// Kind: The kind of item this is. For a template list, this is always
// fusiontables#templateList .
Kind string `json:"kind,omitempty"`
// NextPageToken: Token used to access the next page of this result. No
// token is displayed if there are no more pages left.
NextPageToken string `json:"nextPageToken,omitempty"`
// TotalItems: Total number of templates for the table.
TotalItems int64 `json:"totalItems,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TemplateList) MarshalJSON() ([]byte, error) {
type NoMethod TemplateList
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "fusiontables.column.delete":
type ColumnDeleteCall struct {
s *Service
tableId string
columnId string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes the specified column.
func (r *ColumnService) Delete(tableId string, columnId string) *ColumnDeleteCall {
c := &ColumnDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.columnId = columnId
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ColumnDeleteCall) Fields(s ...googleapi.Field) *ColumnDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ColumnDeleteCall) Context(ctx context.Context) *ColumnDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ColumnDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ColumnDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"columnId": c.columnId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.column.delete" call.
func (c *ColumnDeleteCall) Do(opts ...googleapi.CallOption) error {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Deletes the specified column.",
// "httpMethod": "DELETE",
// "id": "fusiontables.column.delete",
// "parameterOrder": [
// "tableId",
// "columnId"
// ],
// "parameters": {
// "columnId": {
// "description": "Name or identifier for the column being deleted.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "tableId": {
// "description": "Table from which the column is being deleted.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/columns/{columnId}",
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.column.get":
type ColumnGetCall struct {
s *Service
tableId string
columnId string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Retrieves a specific column by its ID.
func (r *ColumnService) Get(tableId string, columnId string) *ColumnGetCall {
c := &ColumnGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.columnId = columnId
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ColumnGetCall) Fields(s ...googleapi.Field) *ColumnGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ColumnGetCall) IfNoneMatch(entityTag string) *ColumnGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ColumnGetCall) Context(ctx context.Context) *ColumnGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ColumnGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ColumnGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"columnId": c.columnId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.column.get" call.
// Exactly one of *Column or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Column.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ColumnGetCall) Do(opts ...googleapi.CallOption) (*Column, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Column{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a specific column by its ID.",
// "httpMethod": "GET",
// "id": "fusiontables.column.get",
// "parameterOrder": [
// "tableId",
// "columnId"
// ],
// "parameters": {
// "columnId": {
// "description": "Name or identifier for the column that is being requested.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "tableId": {
// "description": "Table to which the column belongs.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/columns/{columnId}",
// "response": {
// "$ref": "Column"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ]
// }
}
// method id "fusiontables.column.insert":
type ColumnInsertCall struct {
s *Service
tableId string
column *Column
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Insert: Adds a new column to the table.
func (r *ColumnService) Insert(tableId string, column *Column) *ColumnInsertCall {
c := &ColumnInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.column = column
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ColumnInsertCall) Fields(s ...googleapi.Field) *ColumnInsertCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ColumnInsertCall) Context(ctx context.Context) *ColumnInsertCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ColumnInsertCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ColumnInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.column)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.column.insert" call.
// Exactly one of *Column or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Column.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ColumnInsertCall) Do(opts ...googleapi.CallOption) (*Column, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Column{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds a new column to the table.",
// "httpMethod": "POST",
// "id": "fusiontables.column.insert",
// "parameterOrder": [
// "tableId"
// ],
// "parameters": {
// "tableId": {
// "description": "Table for which a new column is being added.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/columns",
// "request": {
// "$ref": "Column"
// },
// "response": {
// "$ref": "Column"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.column.list":
type ColumnListCall struct {
s *Service
tableId string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Retrieves a list of columns.
func (r *ColumnService) List(tableId string) *ColumnListCall {
c := &ColumnListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of columns to return. Default is 5.
func (c *ColumnListCall) MaxResults(maxResults int64) *ColumnListCall {
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
return c
}
// PageToken sets the optional parameter "pageToken": Continuation token
// specifying which result page to return.
func (c *ColumnListCall) PageToken(pageToken string) *ColumnListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ColumnListCall) Fields(s ...googleapi.Field) *ColumnListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ColumnListCall) IfNoneMatch(entityTag string) *ColumnListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ColumnListCall) Context(ctx context.Context) *ColumnListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ColumnListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ColumnListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.column.list" call.
// Exactly one of *ColumnList or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *ColumnList.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *ColumnListCall) Do(opts ...googleapi.CallOption) (*ColumnList, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ColumnList{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a list of columns.",
// "httpMethod": "GET",
// "id": "fusiontables.column.list",
// "parameterOrder": [
// "tableId"
// ],
// "parameters": {
// "maxResults": {
// "description": "Maximum number of columns to return. Default is 5.",
// "format": "uint32",
// "location": "query",
// "minimum": "0",
// "type": "integer"
// },
// "pageToken": {
// "description": "Continuation token specifying which result page to return.",
// "location": "query",
// "type": "string"
// },
// "tableId": {
// "description": "Table whose columns are being listed.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/columns",
// "response": {
// "$ref": "ColumnList"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ColumnListCall) Pages(ctx context.Context, f func(*ColumnList) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "fusiontables.column.patch":
type ColumnPatchCall struct {
s *Service
tableId string
columnId string
column *Column
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates the name or type of an existing column. This method
// supports patch semantics.
func (r *ColumnService) Patch(tableId string, columnId string, column *Column) *ColumnPatchCall {
c := &ColumnPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.columnId = columnId
c.column = column
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ColumnPatchCall) Fields(s ...googleapi.Field) *ColumnPatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ColumnPatchCall) Context(ctx context.Context) *ColumnPatchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ColumnPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ColumnPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.column)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"columnId": c.columnId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.column.patch" call.
// Exactly one of *Column or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Column.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ColumnPatchCall) Do(opts ...googleapi.CallOption) (*Column, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Column{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates the name or type of an existing column. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "fusiontables.column.patch",
// "parameterOrder": [
// "tableId",
// "columnId"
// ],
// "parameters": {
// "columnId": {
// "description": "Name or identifier for the column that is being updated.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "tableId": {
// "description": "Table for which the column is being updated.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/columns/{columnId}",
// "request": {
// "$ref": "Column"
// },
// "response": {
// "$ref": "Column"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.column.update":
type ColumnUpdateCall struct {
s *Service
tableId string
columnId string
column *Column
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Update: Updates the name or type of an existing column.
func (r *ColumnService) Update(tableId string, columnId string, column *Column) *ColumnUpdateCall {
c := &ColumnUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.columnId = columnId
c.column = column
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ColumnUpdateCall) Fields(s ...googleapi.Field) *ColumnUpdateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ColumnUpdateCall) Context(ctx context.Context) *ColumnUpdateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ColumnUpdateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ColumnUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.column)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/columns/{columnId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PUT", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"columnId": c.columnId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.column.update" call.
// Exactly one of *Column or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Column.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *ColumnUpdateCall) Do(opts ...googleapi.CallOption) (*Column, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Column{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates the name or type of an existing column.",
// "httpMethod": "PUT",
// "id": "fusiontables.column.update",
// "parameterOrder": [
// "tableId",
// "columnId"
// ],
// "parameters": {
// "columnId": {
// "description": "Name or identifier for the column that is being updated.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "tableId": {
// "description": "Table for which the column is being updated.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/columns/{columnId}",
// "request": {
// "$ref": "Column"
// },
// "response": {
// "$ref": "Column"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.query.sql":
type QuerySqlCall struct {
s *Service
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Sql: Executes a Fusion Tables SQL statement, which can be any of
// - SELECT
// - INSERT
// - UPDATE
// - DELETE
// - SHOW
// - DESCRIBE
// - CREATE statement.
func (r *QueryService) Sql(sql string) *QuerySqlCall {
c := &QuerySqlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.urlParams_.Set("sql", sql)
return c
}
// Hdrs sets the optional parameter "hdrs": Whether column names are
// included in the first row. Default is true.
func (c *QuerySqlCall) Hdrs(hdrs bool) *QuerySqlCall {
c.urlParams_.Set("hdrs", fmt.Sprint(hdrs))
return c
}
// Typed sets the optional parameter "typed": Whether typed values are
// returned in the (JSON) response: numbers for numeric values and
// parsed geometries for KML values. Default is true.
func (c *QuerySqlCall) Typed(typed bool) *QuerySqlCall {
c.urlParams_.Set("typed", fmt.Sprint(typed))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *QuerySqlCall) Fields(s ...googleapi.Field) *QuerySqlCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do and Download
// methods. Any pending HTTP request will be aborted if the provided
// context is canceled.
func (c *QuerySqlCall) Context(ctx context.Context) *QuerySqlCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *QuerySqlCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *QuerySqlCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "query")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Download fetches the API endpoint's "media" value, instead of the normal
// API response value. If the returned error is nil, the Response is guaranteed to
// have a 2xx status code. Callers must close the Response.Body as usual.
func (c *QuerySqlCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("media")
if err != nil {
return nil, err
}
if err := googleapi.CheckMediaResponse(res); err != nil {
res.Body.Close()
return nil, err
}
return res, nil
}
// Do executes the "fusiontables.query.sql" call.
// Exactly one of *Sqlresponse or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Sqlresponse.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *QuerySqlCall) Do(opts ...googleapi.CallOption) (*Sqlresponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Sqlresponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Executes a Fusion Tables SQL statement, which can be any of \n- SELECT\n- INSERT\n- UPDATE\n- DELETE\n- SHOW\n- DESCRIBE\n- CREATE statement.",
// "httpMethod": "POST",
// "id": "fusiontables.query.sql",
// "parameterOrder": [
// "sql"
// ],
// "parameters": {
// "hdrs": {
// "description": "Whether column names are included in the first row. Default is true.",
// "location": "query",
// "type": "boolean"
// },
// "sql": {
// "description": "A Fusion Tables SQL statement, which can be any of \n- SELECT\n- INSERT\n- UPDATE\n- DELETE\n- SHOW\n- DESCRIBE\n- CREATE",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "typed": {
// "description": "Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "query",
// "response": {
// "$ref": "Sqlresponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ],
// "supportsMediaDownload": true,
// "useMediaDownloadService": true
// }
}
// method id "fusiontables.query.sqlGet":
type QuerySqlGetCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// SqlGet: Executes a SQL statement which can be any of
// - SELECT
// - SHOW
// - DESCRIBE
func (r *QueryService) SqlGet(sql string) *QuerySqlGetCall {
c := &QuerySqlGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.urlParams_.Set("sql", sql)
return c
}
// Hdrs sets the optional parameter "hdrs": Whether column names are
// included (in the first row). Default is true.
func (c *QuerySqlGetCall) Hdrs(hdrs bool) *QuerySqlGetCall {
c.urlParams_.Set("hdrs", fmt.Sprint(hdrs))
return c
}
// Typed sets the optional parameter "typed": Whether typed values are
// returned in the (JSON) response: numbers for numeric values and
// parsed geometries for KML values. Default is true.
func (c *QuerySqlGetCall) Typed(typed bool) *QuerySqlGetCall {
c.urlParams_.Set("typed", fmt.Sprint(typed))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *QuerySqlGetCall) Fields(s ...googleapi.Field) *QuerySqlGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *QuerySqlGetCall) IfNoneMatch(entityTag string) *QuerySqlGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do and Download
// methods. Any pending HTTP request will be aborted if the provided
// context is canceled.
func (c *QuerySqlGetCall) Context(ctx context.Context) *QuerySqlGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *QuerySqlGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *QuerySqlGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "query")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Download fetches the API endpoint's "media" value, instead of the normal
// API response value. If the returned error is nil, the Response is guaranteed to
// have a 2xx status code. Callers must close the Response.Body as usual.
func (c *QuerySqlGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("media")
if err != nil {
return nil, err
}
if err := googleapi.CheckMediaResponse(res); err != nil {
res.Body.Close()
return nil, err
}
return res, nil
}
// Do executes the "fusiontables.query.sqlGet" call.
// Exactly one of *Sqlresponse or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *Sqlresponse.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *QuerySqlGetCall) Do(opts ...googleapi.CallOption) (*Sqlresponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Sqlresponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Executes a SQL statement which can be any of \n- SELECT\n- SHOW\n- DESCRIBE",
// "httpMethod": "GET",
// "id": "fusiontables.query.sqlGet",
// "parameterOrder": [
// "sql"
// ],
// "parameters": {
// "hdrs": {
// "description": "Whether column names are included (in the first row). Default is true.",
// "location": "query",
// "type": "boolean"
// },
// "sql": {
// "description": "A SQL statement which can be any of \n- SELECT\n- SHOW\n- DESCRIBE",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "typed": {
// "description": "Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "query",
// "response": {
// "$ref": "Sqlresponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ],
// "supportsMediaDownload": true,
// "useMediaDownloadService": true
// }
}
// method id "fusiontables.style.delete":
type StyleDeleteCall struct {
s *Service
tableId string
styleId int64
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a style.
func (r *StyleService) Delete(tableId string, styleId int64) *StyleDeleteCall {
c := &StyleDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.styleId = styleId
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StyleDeleteCall) Fields(s ...googleapi.Field) *StyleDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *StyleDeleteCall) Context(ctx context.Context) *StyleDeleteCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *StyleDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *StyleDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("DELETE", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"styleId": strconv.FormatInt(c.styleId, 10),
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.style.delete" call.
func (c *StyleDeleteCall) Do(opts ...googleapi.CallOption) error {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Deletes a style.",
// "httpMethod": "DELETE",
// "id": "fusiontables.style.delete",
// "parameterOrder": [
// "tableId",
// "styleId"
// ],
// "parameters": {
// "styleId": {
// "description": "Identifier (within a table) for the style being deleted",
// "format": "int32",
// "location": "path",
// "required": true,
// "type": "integer"
// },
// "tableId": {
// "description": "Table from which the style is being deleted",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/styles/{styleId}",
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.style.get":
type StyleGetCall struct {
s *Service
tableId string
styleId int64
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets a specific style.
func (r *StyleService) Get(tableId string, styleId int64) *StyleGetCall {
c := &StyleGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.styleId = styleId
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StyleGetCall) Fields(s ...googleapi.Field) *StyleGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *StyleGetCall) IfNoneMatch(entityTag string) *StyleGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *StyleGetCall) Context(ctx context.Context) *StyleGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *StyleGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *StyleGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"styleId": strconv.FormatInt(c.styleId, 10),
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.style.get" call.
// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *StyleSetting.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *StyleGetCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &StyleSetting{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets a specific style.",
// "httpMethod": "GET",
// "id": "fusiontables.style.get",
// "parameterOrder": [
// "tableId",
// "styleId"
// ],
// "parameters": {
// "styleId": {
// "description": "Identifier (integer) for a specific style in a table",
// "format": "int32",
// "location": "path",
// "required": true,
// "type": "integer"
// },
// "tableId": {
// "description": "Table to which the requested style belongs",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/styles/{styleId}",
// "response": {
// "$ref": "StyleSetting"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ]
// }
}
// method id "fusiontables.style.insert":
type StyleInsertCall struct {
s *Service
tableId string
stylesetting *StyleSetting
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Insert: Adds a new style for the table.
func (r *StyleService) Insert(tableId string, stylesetting *StyleSetting) *StyleInsertCall {
c := &StyleInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.stylesetting = stylesetting
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StyleInsertCall) Fields(s ...googleapi.Field) *StyleInsertCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *StyleInsertCall) Context(ctx context.Context) *StyleInsertCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *StyleInsertCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *StyleInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.style.insert" call.
// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *StyleSetting.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *StyleInsertCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &StyleSetting{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Adds a new style for the table.",
// "httpMethod": "POST",
// "id": "fusiontables.style.insert",
// "parameterOrder": [
// "tableId"
// ],
// "parameters": {
// "tableId": {
// "description": "Table for which a new style is being added",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/styles",
// "request": {
// "$ref": "StyleSetting"
// },
// "response": {
// "$ref": "StyleSetting"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.style.list":
type StyleListCall struct {
s *Service
tableId string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Retrieves a list of styles.
func (r *StyleService) List(tableId string) *StyleListCall {
c := &StyleListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of styles to return. Default is 5.
func (c *StyleListCall) MaxResults(maxResults int64) *StyleListCall {
c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
return c
}
// PageToken sets the optional parameter "pageToken": Continuation token
// specifying which result page to return.
func (c *StyleListCall) PageToken(pageToken string) *StyleListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StyleListCall) Fields(s ...googleapi.Field) *StyleListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *StyleListCall) IfNoneMatch(entityTag string) *StyleListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *StyleListCall) Context(ctx context.Context) *StyleListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *StyleListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *StyleListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.style.list" call.
// Exactly one of *StyleSettingList or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *StyleSettingList.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *StyleListCall) Do(opts ...googleapi.CallOption) (*StyleSettingList, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &StyleSettingList{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a list of styles.",
// "httpMethod": "GET",
// "id": "fusiontables.style.list",
// "parameterOrder": [
// "tableId"
// ],
// "parameters": {
// "maxResults": {
// "description": "Maximum number of styles to return. Optional. Default is 5.",
// "format": "uint32",
// "location": "query",
// "minimum": "0",
// "type": "integer"
// },
// "pageToken": {
// "description": "Continuation token specifying which result page to return. Optional.",
// "location": "query",
// "type": "string"
// },
// "tableId": {
// "description": "Table whose styles are being listed",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/styles",
// "response": {
// "$ref": "StyleSettingList"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ]
// }
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *StyleListCall) Pages(ctx context.Context, f func(*StyleSettingList) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}
// method id "fusiontables.style.patch":
type StylePatchCall struct {
s *Service
tableId string
styleId int64
stylesetting *StyleSetting
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates an existing style. This method supports patch
// semantics.
func (r *StyleService) Patch(tableId string, styleId int64, stylesetting *StyleSetting) *StylePatchCall {
c := &StylePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.styleId = styleId
c.stylesetting = stylesetting
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StylePatchCall) Fields(s ...googleapi.Field) *StylePatchCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *StylePatchCall) Context(ctx context.Context) *StylePatchCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *StylePatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *StylePatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PATCH", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"styleId": strconv.FormatInt(c.styleId, 10),
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.style.patch" call.
// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *StyleSetting.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *StylePatchCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &StyleSetting{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates an existing style. This method supports patch semantics.",
// "httpMethod": "PATCH",
// "id": "fusiontables.style.patch",
// "parameterOrder": [
// "tableId",
// "styleId"
// ],
// "parameters": {
// "styleId": {
// "description": "Identifier (within a table) for the style being updated.",
// "format": "int32",
// "location": "path",
// "required": true,
// "type": "integer"
// },
// "tableId": {
// "description": "Table whose style is being updated.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/styles/{styleId}",
// "request": {
// "$ref": "StyleSetting"
// },
// "response": {
// "$ref": "StyleSetting"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.style.update":
type StyleUpdateCall struct {
s *Service
tableId string
styleId int64
stylesetting *StyleSetting
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Update: Updates an existing style.
func (r *StyleService) Update(tableId string, styleId int64, stylesetting *StyleSetting) *StyleUpdateCall {
c := &StyleUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
c.styleId = styleId
c.stylesetting = stylesetting
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StyleUpdateCall) Fields(s ...googleapi.Field) *StyleUpdateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *StyleUpdateCall) Context(ctx context.Context) *StyleUpdateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *StyleUpdateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *StyleUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.stylesetting)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/styles/{styleId}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("PUT", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
"styleId": strconv.FormatInt(c.styleId, 10),
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.style.update" call.
// Exactly one of *StyleSetting or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *StyleSetting.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
// to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *StyleUpdateCall) Do(opts ...googleapi.CallOption) (*StyleSetting, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &StyleSetting{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Updates an existing style.",
// "httpMethod": "PUT",
// "id": "fusiontables.style.update",
// "parameterOrder": [
// "tableId",
// "styleId"
// ],
// "parameters": {
// "styleId": {
// "description": "Identifier (within a table) for the style being updated.",
// "format": "int32",
// "location": "path",
// "required": true,
// "type": "integer"
// },
// "tableId": {
// "description": "Table whose style is being updated.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/styles/{styleId}",
// "request": {
// "$ref": "StyleSetting"
// },
// "response": {
// "$ref": "StyleSetting"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables"
// ]
// }
}
// method id "fusiontables.table.copy":
type TableCopyCall struct {
s *Service
tableId string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Copy: Copies a table.
func (r *TableService) Copy(tableId string) *TableCopyCall {
c := &TableCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
return c
}
// CopyPresentation sets the optional parameter "copyPresentation":
// Whether to also copy tabs, styles, and templates. Default is false.
func (c *TableCopyCall) CopyPresentation(copyPresentation bool) *TableCopyCall {
c.urlParams_.Set("copyPresentation", fmt.Sprint(copyPresentation))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *TableCopyCall) Fields(s ...googleapi.Field) *TableCopyCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *TableCopyCall) Context(ctx context.Context) *TableCopyCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *TableCopyCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TableCopyCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/copy")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"tableId": c.tableId,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fusiontables.table.copy" call.
// Exactly one of *Table or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Table.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *TableCopyCall) Do(opts ...googleapi.CallOption) (*Table, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Table{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Copies a table.",
// "httpMethod": "POST",
// "id": "fusiontables.table.copy",
// "parameterOrder": [
// "tableId"
// ],
// "parameters": {
// "copyPresentation": {
// "description": "Whether to also copy tabs, styles, and templates. Default is false.",
// "location": "query",
// "type": "boolean"
// },
// "tableId": {
// "description": "ID of the table that is being copied.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "tables/{tableId}/copy",
// "response": {
// "$ref": "Table"
// },
// "scopes": [
// "https://www.googleapis.com/auth/fusiontables",
// "https://www.googleapis.com/auth/fusiontables.readonly"
// ]
// }
}
// method id "fusiontables.table.delete":
type TableDeleteCall struct {
s *Service
tableId string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a table.
func (r *TableService) Delete(tableId string) *TableDeleteCall {
c := &TableDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.tableId = tableId
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *TableDeleteCall) Fields(s ...googleapi.Field) *TableDeleteCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *TableDeleteCall) Context(ctx context.Context) *TableDeleteCall {
c.ctx_ = ctx