Do executes the "fusiontables.table.replaceRows" call. Exactly one of *Task or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Task.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.

Do is referenced in 0 repositories


	//     },
	//     "tableId": {
	//       "description": "ID of the table that is being updated.",
	//       "location": "path",
	//       "required": true,
	//       "type": "string"
	//     }
	//   },
	//   "path": "tables/{tableId}",
	//   "request": {
	//     "$ref": "Table"
	//   },
	//   "response": {
	//     "$ref": "Table"
	//   },
	//   "scopes": [
	//     ""
	//   ]
	// }


// method id "fusiontables.table.replaceRows":

type TableReplaceRowsCall struct {
	s                *Service
	tableId          string
	urlParams_       gensupport.URLParams
	media_           io.Reader
	mediaBuffer_     *gensupport.MediaBuffer
	mediaType_       string
	mediaSize_       int64 // mediaSize, if known.  Used only for calls to progressUpdater_.
	progressUpdater_ googleapi.ProgressUpdater
	ctx_             context.Context

// ReplaceRows: Replaces rows of an existing table. Current rows remain
// visible until all replacement rows are ready.
func (r *TableService) ReplaceRows(tableId string) *TableReplaceRowsCall {
	c := &TableReplaceRowsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.tableId = tableId
	return c

// Delimiter sets the optional parameter "delimiter": The delimiter used
// to separate cell values. This can only consist of a single character.
// Default is ,.
func (c *TableReplaceRowsCall) Delimiter(delimiter string) *TableReplaceRowsCall {
	c.urlParams_.Set("delimiter", delimiter)
	return c

// Encoding sets the optional parameter "encoding": The encoding of the
// content. Default is UTF-8. Use 'auto-detect' if you are unsure of the
// encoding.
func (c *TableReplaceRowsCall) Encoding(encoding string) *TableReplaceRowsCall {
	c.urlParams_.Set("encoding", encoding)
	return c

// EndLine sets the optional parameter "endLine": The index of the line
// up to which data will be imported. Default is to import the entire
// file. If endLine is negative, it is an offset from the end of the
// file; the imported content will exclude the last endLine lines.
func (c *TableReplaceRowsCall) EndLine(endLine int64) *TableReplaceRowsCall {
	c.urlParams_.Set("endLine", fmt.Sprint(endLine))
	return c

// IsStrict sets the optional parameter "isStrict": Whether the imported
// CSV must have the same number of column values for each row. If true,
// throws an exception if the CSV does not have the same number of
// columns. If false, rows with fewer column values will be padded with
// empty values. Default is true.
func (c *TableReplaceRowsCall) IsStrict(isStrict bool) *TableReplaceRowsCall {
	c.urlParams_.Set("isStrict", fmt.Sprint(isStrict))
	return c

// StartLine sets the optional parameter "startLine": The index of the
// first line from which to start importing, inclusive. Default is 0.
func (c *TableReplaceRowsCall) StartLine(startLine int64) *TableReplaceRowsCall {
	c.urlParams_.Set("startLine", fmt.Sprint(startLine))
	return c

// Media specifies the media to upload in one or more chunks. The chunk
// size may be controlled by supplying a MediaOption generated by
// googleapi.ChunkSize. The chunk size defaults to
// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
// upload request will be determined by sniffing the contents of r,
// unless a MediaOption generated by googleapi.ContentType is
// supplied.
// At most one of Media and ResumableMedia may be set.
func (c *TableReplaceRowsCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableReplaceRowsCall {
	opts := googleapi.ProcessMediaOptions(options)
	chunkSize := opts.ChunkSize
	if !opts.ForceEmptyContentType {
		r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
	c.media_, c.mediaBuffer_ = gensupport.PrepareUpload(r, chunkSize)
	return c

// ResumableMedia specifies the media to upload in chunks and can be
// canceled with ctx.
// Deprecated: use Media instead.
// At most one of Media and ResumableMedia may be set. mediaType
// identifies the MIME media type of the upload, such as "image/png". If
// mediaType is "", it will be auto-detected. The provided ctx will
// supersede any context previously provided to the Context method.
func (c *TableReplaceRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableReplaceRowsCall {
	c.ctx_ = ctx
	rdr := gensupport.ReaderAtToReader(r, size)
	rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
	c.mediaBuffer_ = gensupport.NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize)
	c.media_ = nil
	c.mediaSize_ = size
	return c

// ProgressUpdater provides a callback function that will be called
// after every chunk. It should be a low-latency function in order to
// not slow down the upload operation. This should only be called when