blob: dbbc61dc4d0cebedee0113966c992d009cdb01e9 [file] [log] [blame]
// Copyright 2020 Google LLC.
// 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 area120tables provides access to the Area120 Tables API.
//
// For product documentation, see: https://tables.area120.google.com
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/area120tables/v1alpha1"
// ...
// ctx := context.Background()
// area120tablesService, err := area120tables.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// area120tablesService, err := area120tables.NewService(ctx, option.WithScopes(area120tables.SpreadsheetsReadonlyScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// area120tablesService, err := area120tables.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// area120tablesService, err := area120tables.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package area120tables // import "google.golang.org/api/area120tables/v1alpha1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// 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
var _ = internaloption.WithDefaultEndpoint
const apiId = "area120tables:v1alpha1"
const apiName = "area120tables"
const apiVersion = "v1alpha1"
const basePath = "https://area120tables.googleapis.com/"
const mtlsBasePath = "https://area120tables.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, create, and delete all of your Google Drive files
DriveScope = "https://www.googleapis.com/auth/drive"
// View and manage Google Drive files and folders that you have opened
// or created with this app
DriveFileScope = "https://www.googleapis.com/auth/drive.file"
// See and download all your Google Drive files
DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
// See, edit, create, and delete your spreadsheets in Google Drive
SpreadsheetsScope = "https://www.googleapis.com/auth/spreadsheets"
// View your Google Spreadsheets
SpreadsheetsReadonlyScope = "https://www.googleapis.com/auth/spreadsheets.readonly"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.readonly",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/spreadsheets.readonly",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Tables = NewTablesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Tables *TablesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewTablesService(s *Service) *TablesService {
rs := &TablesService{s: s}
rs.Rows = NewTablesRowsService(s)
return rs
}
type TablesService struct {
s *Service
Rows *TablesRowsService
}
func NewTablesRowsService(s *Service) *TablesRowsService {
rs := &TablesRowsService{s: s}
return rs
}
type TablesRowsService struct {
s *Service
}
// BatchCreateRowsRequest: Request message for
// TablesService.BatchCreateRows.
type BatchCreateRowsRequest struct {
// Requests: Required. The request message specifying the rows to
// create. A maximum of 500 rows can be created in a single batch.
Requests []*CreateRowRequest `json:"requests,omitempty"`
// ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchCreateRowsRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateRowsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchCreateRowsResponse: Response message for
// TablesService.BatchCreateRows.
type BatchCreateRowsResponse struct {
// Rows: The created rows.
Rows []*Row `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. "Rows") 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. "Rows") 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 *BatchCreateRowsResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchCreateRowsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchUpdateRowsRequest: Request message for
// TablesService.BatchUpdateRows.
type BatchUpdateRowsRequest struct {
// Requests: Required. The request messages specifying the rows to
// update. A maximum of 500 rows can be modified in a single batch.
Requests []*UpdateRowRequest `json:"requests,omitempty"`
// ForceSendFields is a list of field names (e.g. "Requests") 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. "Requests") 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 *BatchUpdateRowsRequest) MarshalJSON() ([]byte, error) {
type NoMethod BatchUpdateRowsRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BatchUpdateRowsResponse: Response message for
// TablesService.BatchUpdateRows.
type BatchUpdateRowsResponse struct {
// Rows: The updated rows.
Rows []*Row `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. "Rows") 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. "Rows") 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 *BatchUpdateRowsResponse) MarshalJSON() ([]byte, error) {
type NoMethod BatchUpdateRowsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ColumnDescription: Details on a column in the table.
type ColumnDescription struct {
// DataType: Data type of the column Supported types are auto_id,
// boolean, boolean_list, creator, create_timestamp, date, dropdown,
// location, integer, integer_list, number, number_list, person,
// person_list, tags, check_list, text, text_list, update_timestamp,
// updater, relationship, file_attachment_list. These types directly map
// to the column types supported on Tables website.
DataType string `json:"dataType,omitempty"`
// Id: Internal id for a column.
Id string `json:"id,omitempty"`
// Labels: Optional. Range of labeled values for the column. Some
// columns like tags and drop-downs limit the values to a set of
// possible values. We return the range of values in such cases to help
// clients implement better user data validation.
Labels []*LabeledItem `json:"labels,omitempty"`
// LookupDetails: Optional. Indicates that this is a lookup column whose
// value is derived from the relationship column specified in the
// details. Lookup columns can not be updated directly. To change the
// value you must update the associated relationship column.
LookupDetails *LookupDetails `json:"lookupDetails,omitempty"`
// Name: column name
Name string `json:"name,omitempty"`
// RelationshipDetails: Optional. Additional details about a
// relationship column. Specified when data_type is relationship.
RelationshipDetails *RelationshipDetails `json:"relationshipDetails,omitempty"`
// ForceSendFields is a list of field names (e.g. "DataType") 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. "DataType") 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 *ColumnDescription) MarshalJSON() ([]byte, error) {
type NoMethod ColumnDescription
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateRowRequest: Request message for TablesService.CreateRow.
type CreateRowRequest struct {
// Parent: Required. The parent table where this row will be created.
// Format: tables/{table}
Parent string `json:"parent,omitempty"`
// Row: Required. The row to create.
Row *Row `json:"row,omitempty"`
// View: Optional. Column key to use for values in the row. Defaults to
// user entered name.
//
// Possible values:
// "VIEW_UNSPECIFIED" - Defaults to user entered text.
// "COLUMN_ID_VIEW" - Uses internally generated column id to identify
// values.
View string `json:"view,omitempty"`
// ForceSendFields is a list of field names (e.g. "Parent") 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. "Parent") 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 *CreateRowRequest) MarshalJSON() ([]byte, error) {
type NoMethod CreateRowRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); } The JSON representation for `Empty` is
// empty JSON object `{}`.
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// LabeledItem: A single item in a labeled column.
type LabeledItem struct {
// Id: Internal id associated with the item.
Id string `json:"id,omitempty"`
// Name: Display string as entered by user.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *LabeledItem) MarshalJSON() ([]byte, error) {
type NoMethod LabeledItem
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListRowsResponse: Response message for TablesService.ListRows.
type ListRowsResponse struct {
// NextPageToken: A token, which can be sent as `page_token` to retrieve
// the next page. If this field is empty, there are no subsequent pages.
NextPageToken string `json:"nextPageToken,omitempty"`
// Rows: The rows from the specified table.
Rows []*Row `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. "NextPageToken") 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. "NextPageToken") 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 *ListRowsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListRowsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListTablesResponse: Response message for TablesService.ListTables.
type ListTablesResponse struct {
// NextPageToken: A token, which can be sent as `page_token` to retrieve
// the next page. If this field is empty, there are no subsequent pages.
NextPageToken string `json:"nextPageToken,omitempty"`
// Tables: The list of tables.
Tables []*Table `json:"tables,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 *ListTablesResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListTablesResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// LookupDetails: Details about a lookup column whose value comes from
// the associated relationship.
type LookupDetails struct {
// RelationshipColumn: The name of the relationship column associated
// with the lookup.
RelationshipColumn string `json:"relationshipColumn,omitempty"`
// RelationshipColumnId: The id of the relationship column.
RelationshipColumnId string `json:"relationshipColumnId,omitempty"`
// ForceSendFields is a list of field names (e.g. "RelationshipColumn")
// 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. "RelationshipColumn") 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 *LookupDetails) MarshalJSON() ([]byte, error) {
type NoMethod LookupDetails
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RelationshipDetails: Details about a relationship column.
type RelationshipDetails struct {
// LinkedTable: The name of the table this relationship is linked to.
LinkedTable string `json:"linkedTable,omitempty"`
// ForceSendFields is a list of field names (e.g. "LinkedTable") 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. "LinkedTable") 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 *RelationshipDetails) MarshalJSON() ([]byte, error) {
type NoMethod RelationshipDetails
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Row: A single row in a table.
type Row struct {
// Name: The resource name of the row. Row names have the form
// `tables/{table}/rows/{row}`. The name is ignored when creating a row.
Name string `json:"name,omitempty"`
// Values: The values of the row. This is a map of column key to value.
// Key is user entered name(default) or the internal column id based on
// the view in the request.
Values googleapi.RawMessage `json:"values,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 *Row) MarshalJSON() ([]byte, error) {
type NoMethod Row
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Table: A single table.
type Table struct {
// Columns: List of columns in this table. Order of columns matches the
// display order.
Columns []*ColumnDescription `json:"columns,omitempty"`
// DisplayName: The human readable title of the table.
DisplayName string `json:"displayName,omitempty"`
// Name: The resource name of the table. Table names have the form
// `tables/{table}`.
Name string `json:"name,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 *Table) MarshalJSON() ([]byte, error) {
type NoMethod Table
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// UpdateRowRequest: Request message for TablesService.UpdateRow.
type UpdateRowRequest struct {
// Row: Required. The row to update.
Row *Row `json:"row,omitempty"`
// UpdateMask: The list of fields to update.
UpdateMask string `json:"updateMask,omitempty"`
// View: Optional. Column key to use for values in the row. Defaults to
// user entered name.
//
// Possible values:
// "VIEW_UNSPECIFIED" - Defaults to user entered text.
// "COLUMN_ID_VIEW" - Uses internally generated column id to identify
// values.
View string `json:"view,omitempty"`
// ForceSendFields is a list of field names (e.g. "Row") 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. "Row") 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 *UpdateRowRequest) MarshalJSON() ([]byte, error) {
type NoMethod UpdateRowRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "area120tables.tables.get":
type TablesGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets a table. Returns NOT_FOUND if the table does not exist.
func (r *TablesService) Get(name string) *TablesGetCall {
c := &TablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
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 *TablesGetCall) Fields(s ...googleapi.Field) *TablesGetCall {
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 *TablesGetCall) IfNoneMatch(entityTag string) *TablesGetCall {
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 *TablesGetCall) Context(ctx context.Context) *TablesGetCall {
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 *TablesGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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, "v1alpha1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.get" 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 *TablesGetCall) 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": "Gets a table. Returns NOT_FOUND if the table does not exist.",
// "flatPath": "v1alpha1/tables/{tablesId}",
// "httpMethod": "GET",
// "id": "area120tables.tables.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the table to retrieve. Format: tables/{table}",
// "location": "path",
// "pattern": "^tables/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "response": {
// "$ref": "Table"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/drive.readonly",
// "https://www.googleapis.com/auth/spreadsheets",
// "https://www.googleapis.com/auth/spreadsheets.readonly"
// ]
// }
}
// method id "area120tables.tables.list":
type TablesListCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists tables for the user.
func (r *TablesService) List() *TablesListCall {
c := &TablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of tables to return. The service may return fewer than this value. If
// unspecified, at most 20 tables are returned. The maximum value is
// 100; values above 100 are coerced to 100.
func (c *TablesListCall) PageSize(pageSize int64) *TablesListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": A page token,
// received from a previous `ListTables` call. Provide this to retrieve
// the subsequent page. When paginating, all other parameters provided
// to `ListTables` must match the call that provided the page token.
func (c *TablesListCall) PageToken(pageToken string) *TablesListCall {
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 *TablesListCall) Fields(s ...googleapi.Field) *TablesListCall {
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 *TablesListCall) IfNoneMatch(entityTag string) *TablesListCall {
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 *TablesListCall) Context(ctx context.Context) *TablesListCall {
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 *TablesListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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, "v1alpha1/tables")
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)
}
// Do executes the "area120tables.tables.list" call.
// Exactly one of *ListTablesResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListTablesResponse.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 *TablesListCall) Do(opts ...googleapi.CallOption) (*ListTablesResponse, 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 := &ListTablesResponse{
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": "Lists tables for the user.",
// "flatPath": "v1alpha1/tables",
// "httpMethod": "GET",
// "id": "area120tables.tables.list",
// "parameterOrder": [],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of tables to return. The service may return fewer than this value. If unspecified, at most 20 tables are returned. The maximum value is 100; values above 100 are coerced to 100.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A page token, received from a previous `ListTables` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListTables` must match the call that provided the page token.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/tables",
// "response": {
// "$ref": "ListTablesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/spreadsheets"
// ]
// }
}
// 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 *TablesListCall) Pages(ctx context.Context, f func(*ListTablesResponse) 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 "area120tables.tables.rows.batchCreate":
type TablesRowsBatchCreateCall struct {
s *Service
parent string
batchcreaterowsrequest *BatchCreateRowsRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// BatchCreate: Creates multiple rows.
func (r *TablesRowsService) BatchCreate(parent string, batchcreaterowsrequest *BatchCreateRowsRequest) *TablesRowsBatchCreateCall {
c := &TablesRowsBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.batchcreaterowsrequest = batchcreaterowsrequest
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 *TablesRowsBatchCreateCall) Fields(s ...googleapi.Field) *TablesRowsBatchCreateCall {
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 *TablesRowsBatchCreateCall) Context(ctx context.Context) *TablesRowsBatchCreateCall {
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 *TablesRowsBatchCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsBatchCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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.batchcreaterowsrequest)
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, "v1alpha1/{+parent}/rows:batchCreate")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.batchCreate" call.
// Exactly one of *BatchCreateRowsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *BatchCreateRowsResponse.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 *TablesRowsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateRowsResponse, 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 := &BatchCreateRowsResponse{
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": "Creates multiple rows.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows:batchCreate",
// "httpMethod": "POST",
// "id": "area120tables.tables.rows.batchCreate",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The parent table where the rows will be created. Format: tables/{table}",
// "location": "path",
// "pattern": "^tables/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/rows:batchCreate",
// "request": {
// "$ref": "BatchCreateRowsRequest"
// },
// "response": {
// "$ref": "BatchCreateRowsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/spreadsheets"
// ]
// }
}
// method id "area120tables.tables.rows.batchUpdate":
type TablesRowsBatchUpdateCall struct {
s *Service
parent string
batchupdaterowsrequest *BatchUpdateRowsRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// BatchUpdate: Updates multiple rows.
func (r *TablesRowsService) BatchUpdate(parent string, batchupdaterowsrequest *BatchUpdateRowsRequest) *TablesRowsBatchUpdateCall {
c := &TablesRowsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.batchupdaterowsrequest = batchupdaterowsrequest
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 *TablesRowsBatchUpdateCall) Fields(s ...googleapi.Field) *TablesRowsBatchUpdateCall {
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 *TablesRowsBatchUpdateCall) Context(ctx context.Context) *TablesRowsBatchUpdateCall {
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 *TablesRowsBatchUpdateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsBatchUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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.batchupdaterowsrequest)
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, "v1alpha1/{+parent}/rows:batchUpdate")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.batchUpdate" call.
// Exactly one of *BatchUpdateRowsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *BatchUpdateRowsResponse.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 *TablesRowsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateRowsResponse, 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 := &BatchUpdateRowsResponse{
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 multiple rows.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows:batchUpdate",
// "httpMethod": "POST",
// "id": "area120tables.tables.rows.batchUpdate",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The parent table shared by all rows being updated. Format: tables/{table}",
// "location": "path",
// "pattern": "^tables/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/rows:batchUpdate",
// "request": {
// "$ref": "BatchUpdateRowsRequest"
// },
// "response": {
// "$ref": "BatchUpdateRowsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/spreadsheets"
// ]
// }
}
// method id "area120tables.tables.rows.create":
type TablesRowsCreateCall struct {
s *Service
parent string
row *Row
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates a row.
func (r *TablesRowsService) Create(parent string, row *Row) *TablesRowsCreateCall {
c := &TablesRowsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
c.row = row
return c
}
// View sets the optional parameter "view": Column key to use for values
// in the row. Defaults to user entered name.
//
// Possible values:
// "VIEW_UNSPECIFIED" - Defaults to user entered text.
// "COLUMN_ID_VIEW" - Uses internally generated column id to identify
// values.
func (c *TablesRowsCreateCall) View(view string) *TablesRowsCreateCall {
c.urlParams_.Set("view", view)
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 *TablesRowsCreateCall) Fields(s ...googleapi.Field) *TablesRowsCreateCall {
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 *TablesRowsCreateCall) Context(ctx context.Context) *TablesRowsCreateCall {
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 *TablesRowsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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.row)
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, "v1alpha1/{+parent}/rows")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.create" call.
// Exactly one of *Row or error will be non-nil. Any non-2xx status code
// is an error. Response headers are in either
// *Row.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 *TablesRowsCreateCall) Do(opts ...googleapi.CallOption) (*Row, 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 := &Row{
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": "Creates a row.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows",
// "httpMethod": "POST",
// "id": "area120tables.tables.rows.create",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "parent": {
// "description": "Required. The parent table where this row will be created. Format: tables/{table}",
// "location": "path",
// "pattern": "^tables/[^/]+$",
// "required": true,
// "type": "string"
// },
// "view": {
// "description": "Optional. Column key to use for values in the row. Defaults to user entered name.",
// "enum": [
// "VIEW_UNSPECIFIED",
// "COLUMN_ID_VIEW"
// ],
// "enumDescriptions": [
// "Defaults to user entered text.",
// "Uses internally generated column id to identify values."
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/rows",
// "request": {
// "$ref": "Row"
// },
// "response": {
// "$ref": "Row"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/spreadsheets"
// ]
// }
}
// method id "area120tables.tables.rows.delete":
type TablesRowsDeleteCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Delete: Deletes a row.
func (r *TablesRowsService) Delete(name string) *TablesRowsDeleteCall {
c := &TablesRowsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
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 *TablesRowsDeleteCall) Fields(s ...googleapi.Field) *TablesRowsDeleteCall {
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 *TablesRowsDeleteCall) Context(ctx context.Context) *TablesRowsDeleteCall {
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 *TablesRowsDeleteCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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, "v1alpha1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.delete" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.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 *TablesRowsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, 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 := &Empty{
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": "Deletes a row.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows/{rowsId}",
// "httpMethod": "DELETE",
// "id": "area120tables.tables.rows.delete",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the row to delete. Format: tables/{table}/rows/{row}",
// "location": "path",
// "pattern": "^tables/[^/]+/rows/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/spreadsheets"
// ]
// }
}
// method id "area120tables.tables.rows.get":
type TablesRowsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets a row. Returns NOT_FOUND if the row does not exist in the
// table.
func (r *TablesRowsService) Get(name string) *TablesRowsGetCall {
c := &TablesRowsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// View sets the optional parameter "view": Column key to use for values
// in the row. Defaults to user entered name.
//
// Possible values:
// "VIEW_UNSPECIFIED" - Defaults to user entered text.
// "COLUMN_ID_VIEW" - Uses internally generated column id to identify
// values.
func (c *TablesRowsGetCall) View(view string) *TablesRowsGetCall {
c.urlParams_.Set("view", view)
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 *TablesRowsGetCall) Fields(s ...googleapi.Field) *TablesRowsGetCall {
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 *TablesRowsGetCall) IfNoneMatch(entityTag string) *TablesRowsGetCall {
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 *TablesRowsGetCall) Context(ctx context.Context) *TablesRowsGetCall {
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 *TablesRowsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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, "v1alpha1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.get" call.
// Exactly one of *Row or error will be non-nil. Any non-2xx status code
// is an error. Response headers are in either
// *Row.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 *TablesRowsGetCall) Do(opts ...googleapi.CallOption) (*Row, 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 := &Row{
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 row. Returns NOT_FOUND if the row does not exist in the table.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows/{rowsId}",
// "httpMethod": "GET",
// "id": "area120tables.tables.rows.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "Required. The name of the row to retrieve. Format: tables/{table}/rows/{row}",
// "location": "path",
// "pattern": "^tables/[^/]+/rows/[^/]+$",
// "required": true,
// "type": "string"
// },
// "view": {
// "description": "Optional. Column key to use for values in the row. Defaults to user entered name.",
// "enum": [
// "VIEW_UNSPECIFIED",
// "COLUMN_ID_VIEW"
// ],
// "enumDescriptions": [
// "Defaults to user entered text.",
// "Uses internally generated column id to identify values."
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "response": {
// "$ref": "Row"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/drive.readonly",
// "https://www.googleapis.com/auth/spreadsheets",
// "https://www.googleapis.com/auth/spreadsheets.readonly"
// ]
// }
}
// method id "area120tables.tables.rows.list":
type TablesRowsListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Lists rows in a table. Returns NOT_FOUND if the table does not
// exist.
func (r *TablesRowsService) List(parent string) *TablesRowsListCall {
c := &TablesRowsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of rows to return. The service may return fewer than this value. If
// unspecified, at most 50 rows are returned. The maximum value is
// 1,000; values above 1,000 are coerced to 1,000.
func (c *TablesRowsListCall) PageSize(pageSize int64) *TablesRowsListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": A page token,
// received from a previous `ListRows` call. Provide this to retrieve
// the subsequent page. When paginating, all other parameters provided
// to `ListRows` must match the call that provided the page token.
func (c *TablesRowsListCall) PageToken(pageToken string) *TablesRowsListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// View sets the optional parameter "view": Column key to use for values
// in the row. Defaults to user entered name.
//
// Possible values:
// "VIEW_UNSPECIFIED" - Defaults to user entered text.
// "COLUMN_ID_VIEW" - Uses internally generated column id to identify
// values.
func (c *TablesRowsListCall) View(view string) *TablesRowsListCall {
c.urlParams_.Set("view", view)
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 *TablesRowsListCall) Fields(s ...googleapi.Field) *TablesRowsListCall {
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 *TablesRowsListCall) IfNoneMatch(entityTag string) *TablesRowsListCall {
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 *TablesRowsListCall) Context(ctx context.Context) *TablesRowsListCall {
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 *TablesRowsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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, "v1alpha1/{+parent}/rows")
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{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.list" call.
// Exactly one of *ListRowsResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListRowsResponse.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 *TablesRowsListCall) Do(opts ...googleapi.CallOption) (*ListRowsResponse, 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 := &ListRowsResponse{
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": "Lists rows in a table. Returns NOT_FOUND if the table does not exist.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows",
// "httpMethod": "GET",
// "id": "area120tables.tables.rows.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "pageSize": {
// "description": "The maximum number of rows to return. The service may return fewer than this value. If unspecified, at most 50 rows are returned. The maximum value is 1,000; values above 1,000 are coerced to 1,000.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A page token, received from a previous `ListRows` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListRows` must match the call that provided the page token.",
// "location": "query",
// "type": "string"
// },
// "parent": {
// "description": "Required. The parent table. Format: tables/{table}",
// "location": "path",
// "pattern": "^tables/[^/]+$",
// "required": true,
// "type": "string"
// },
// "view": {
// "description": "Optional. Column key to use for values in the row. Defaults to user entered name.",
// "enum": [
// "VIEW_UNSPECIFIED",
// "COLUMN_ID_VIEW"
// ],
// "enumDescriptions": [
// "Defaults to user entered text.",
// "Uses internally generated column id to identify values."
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/{+parent}/rows",
// "response": {
// "$ref": "ListRowsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/drive.readonly",
// "https://www.googleapis.com/auth/spreadsheets",
// "https://www.googleapis.com/auth/spreadsheets.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 *TablesRowsListCall) Pages(ctx context.Context, f func(*ListRowsResponse) 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 "area120tables.tables.rows.patch":
type TablesRowsPatchCall struct {
s *Service
name string
row *Row
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Patch: Updates a row.
func (r *TablesRowsService) Patch(name string, row *Row) *TablesRowsPatchCall {
c := &TablesRowsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
c.row = row
return c
}
// UpdateMask sets the optional parameter "updateMask": The list of
// fields to update.
func (c *TablesRowsPatchCall) UpdateMask(updateMask string) *TablesRowsPatchCall {
c.urlParams_.Set("updateMask", updateMask)
return c
}
// View sets the optional parameter "view": Column key to use for values
// in the row. Defaults to user entered name.
//
// Possible values:
// "VIEW_UNSPECIFIED" - Defaults to user entered text.
// "COLUMN_ID_VIEW" - Uses internally generated column id to identify
// values.
func (c *TablesRowsPatchCall) View(view string) *TablesRowsPatchCall {
c.urlParams_.Set("view", view)
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 *TablesRowsPatchCall) Fields(s ...googleapi.Field) *TablesRowsPatchCall {
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 *TablesRowsPatchCall) Context(ctx context.Context) *TablesRowsPatchCall {
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 *TablesRowsPatchCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *TablesRowsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201002")
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.row)
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, "v1alpha1/{+name}")
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{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "area120tables.tables.rows.patch" call.
// Exactly one of *Row or error will be non-nil. Any non-2xx status code
// is an error. Response headers are in either
// *Row.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 *TablesRowsPatchCall) Do(opts ...googleapi.CallOption) (*Row, 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 := &Row{
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 a row.",
// "flatPath": "v1alpha1/tables/{tablesId}/rows/{rowsId}",
// "httpMethod": "PATCH",
// "id": "area120tables.tables.rows.patch",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the row. Row names have the form `tables/{table}/rows/{row}`. The name is ignored when creating a row.",
// "location": "path",
// "pattern": "^tables/[^/]+/rows/[^/]+$",
// "required": true,
// "type": "string"
// },
// "updateMask": {
// "description": "The list of fields to update.",
// "format": "google-fieldmask",
// "location": "query",
// "type": "string"
// },
// "view": {
// "description": "Optional. Column key to use for values in the row. Defaults to user entered name.",
// "enum": [
// "VIEW_UNSPECIFIED",
// "COLUMN_ID_VIEW"
// ],
// "enumDescriptions": [
// "Defaults to user entered text.",
// "Uses internally generated column id to identify values."
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1alpha1/{+name}",
// "request": {
// "$ref": "Row"
// },
// "response": {
// "$ref": "Row"
// },
// "scopes": [
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.file",
// "https://www.googleapis.com/auth/spreadsheets"
// ]
// }
}