Update dependencies
This commit is contained in:
parent
f3b49987f8
commit
fda563d606
926 changed files with 189726 additions and 98666 deletions
134
vendor/google.golang.org/api/fusiontables/v1/fusiontables-gen.go
generated
vendored
134
vendor/google.golang.org/api/fusiontables/v1/fusiontables-gen.go
generated
vendored
|
@ -3664,16 +3664,12 @@ func (c *TableGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
|
|||
// method id "fusiontables.table.importRows":
|
||||
|
||||
type TableImportRowsCall 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
|
||||
header_ http.Header
|
||||
s *Service
|
||||
tableId string
|
||||
urlParams_ gensupport.URLParams
|
||||
mediaInfo_ *gensupport.MediaInfo
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// ImportRows: Import more rows into a table.
|
||||
|
@ -3737,12 +3733,7 @@ func (c *TableImportRowsCall) StartLine(startLine int64) *TableImportRowsCall {
|
|||
// supplied.
|
||||
// At most one of Media and ResumableMedia may be set.
|
||||
func (c *TableImportRowsCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableImportRowsCall {
|
||||
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)
|
||||
c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -3757,11 +3748,7 @@ func (c *TableImportRowsCall) Media(r io.Reader, options ...googleapi.MediaOptio
|
|||
// supersede any context previously provided to the Context method.
|
||||
func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportRowsCall {
|
||||
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
|
||||
c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -3770,7 +3757,7 @@ func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt,
|
|||
// not slow down the upload operation. This should only be called when
|
||||
// using ResumableMedia (as opposed to Media).
|
||||
func (c *TableImportRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportRowsCall {
|
||||
c.progressUpdater_ = pu
|
||||
c.mediaInfo_.SetProgressUpdater(pu)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -3810,27 +3797,16 @@ func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) {
|
|||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/import")
|
||||
if c.media_ != nil || c.mediaBuffer_ != nil {
|
||||
if c.mediaInfo_ != nil {
|
||||
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
|
||||
protocol := "multipart"
|
||||
if c.mediaBuffer_ != nil {
|
||||
protocol = "resumable"
|
||||
}
|
||||
c.urlParams_.Set("uploadType", protocol)
|
||||
c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
|
||||
}
|
||||
if body == nil {
|
||||
body = new(bytes.Buffer)
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
}
|
||||
if c.media_ != nil {
|
||||
combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
|
||||
defer combined.Close()
|
||||
reqHeaders.Set("Content-Type", ctype)
|
||||
body = combined
|
||||
}
|
||||
if c.mediaBuffer_ != nil && c.mediaType_ != "" {
|
||||
reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
|
||||
}
|
||||
body, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
|
||||
defer cleanup()
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
|
@ -3866,20 +3842,10 @@ func (c *TableImportRowsCall) Do(opts ...googleapi.CallOption) (*Import, error)
|
|||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.mediaBuffer_ != nil {
|
||||
loc := res.Header.Get("Location")
|
||||
rx := &gensupport.ResumableUpload{
|
||||
Client: c.s.client,
|
||||
UserAgent: c.s.userAgent(),
|
||||
URI: loc,
|
||||
Media: c.mediaBuffer_,
|
||||
MediaType: c.mediaType_,
|
||||
Callback: func(curr int64) {
|
||||
if c.progressUpdater_ != nil {
|
||||
c.progressUpdater_(curr, c.mediaSize_)
|
||||
}
|
||||
},
|
||||
}
|
||||
rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
|
||||
if rx != nil {
|
||||
rx.Client = c.s.client
|
||||
rx.UserAgent = c.s.userAgent()
|
||||
ctx := c.ctx_
|
||||
if ctx == nil {
|
||||
ctx = context.TODO()
|
||||
|
@ -3977,15 +3943,11 @@ func (c *TableImportRowsCall) Do(opts ...googleapi.CallOption) (*Import, error)
|
|||
// method id "fusiontables.table.importTable":
|
||||
|
||||
type TableImportTableCall struct {
|
||||
s *Service
|
||||
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
|
||||
header_ http.Header
|
||||
s *Service
|
||||
urlParams_ gensupport.URLParams
|
||||
mediaInfo_ *gensupport.MediaInfo
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// ImportTable: Import a new table.
|
||||
|
@ -4020,12 +3982,7 @@ func (c *TableImportTableCall) Encoding(encoding string) *TableImportTableCall {
|
|||
// supplied.
|
||||
// At most one of Media and ResumableMedia may be set.
|
||||
func (c *TableImportTableCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableImportTableCall {
|
||||
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)
|
||||
c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4040,11 +3997,7 @@ func (c *TableImportTableCall) Media(r io.Reader, options ...googleapi.MediaOpti
|
|||
// supersede any context previously provided to the Context method.
|
||||
func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportTableCall {
|
||||
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
|
||||
c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4053,7 +4006,7 @@ func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt
|
|||
// not slow down the upload operation. This should only be called when
|
||||
// using ResumableMedia (as opposed to Media).
|
||||
func (c *TableImportTableCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportTableCall {
|
||||
c.progressUpdater_ = pu
|
||||
c.mediaInfo_.SetProgressUpdater(pu)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4093,27 +4046,16 @@ func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) {
|
|||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/import")
|
||||
if c.media_ != nil || c.mediaBuffer_ != nil {
|
||||
if c.mediaInfo_ != nil {
|
||||
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
|
||||
protocol := "multipart"
|
||||
if c.mediaBuffer_ != nil {
|
||||
protocol = "resumable"
|
||||
}
|
||||
c.urlParams_.Set("uploadType", protocol)
|
||||
c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
|
||||
}
|
||||
if body == nil {
|
||||
body = new(bytes.Buffer)
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
}
|
||||
if c.media_ != nil {
|
||||
combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
|
||||
defer combined.Close()
|
||||
reqHeaders.Set("Content-Type", ctype)
|
||||
body = combined
|
||||
}
|
||||
if c.mediaBuffer_ != nil && c.mediaType_ != "" {
|
||||
reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
|
||||
}
|
||||
body, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
|
||||
defer cleanup()
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
|
@ -4146,20 +4088,10 @@ func (c *TableImportTableCall) Do(opts ...googleapi.CallOption) (*Table, error)
|
|||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.mediaBuffer_ != nil {
|
||||
loc := res.Header.Get("Location")
|
||||
rx := &gensupport.ResumableUpload{
|
||||
Client: c.s.client,
|
||||
UserAgent: c.s.userAgent(),
|
||||
URI: loc,
|
||||
Media: c.mediaBuffer_,
|
||||
MediaType: c.mediaType_,
|
||||
Callback: func(curr int64) {
|
||||
if c.progressUpdater_ != nil {
|
||||
c.progressUpdater_(curr, c.mediaSize_)
|
||||
}
|
||||
},
|
||||
}
|
||||
rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
|
||||
if rx != nil {
|
||||
rx.Client = c.s.client
|
||||
rx.UserAgent = c.s.userAgent()
|
||||
ctx := c.ctx_
|
||||
if ctx == nil {
|
||||
ctx = context.TODO()
|
||||
|
|
202
vendor/google.golang.org/api/fusiontables/v2/fusiontables-gen.go
generated
vendored
202
vendor/google.golang.org/api/fusiontables/v2/fusiontables-gen.go
generated
vendored
|
@ -3731,16 +3731,12 @@ func (c *TableGetCall) Do(opts ...googleapi.CallOption) (*Table, error) {
|
|||
// method id "fusiontables.table.importRows":
|
||||
|
||||
type TableImportRowsCall 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
|
||||
header_ http.Header
|
||||
s *Service
|
||||
tableId string
|
||||
urlParams_ gensupport.URLParams
|
||||
mediaInfo_ *gensupport.MediaInfo
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// ImportRows: Imports more rows into a table.
|
||||
|
@ -3799,12 +3795,7 @@ func (c *TableImportRowsCall) StartLine(startLine int64) *TableImportRowsCall {
|
|||
// supplied.
|
||||
// At most one of Media and ResumableMedia may be set.
|
||||
func (c *TableImportRowsCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableImportRowsCall {
|
||||
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)
|
||||
c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -3819,11 +3810,7 @@ func (c *TableImportRowsCall) Media(r io.Reader, options ...googleapi.MediaOptio
|
|||
// supersede any context previously provided to the Context method.
|
||||
func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportRowsCall {
|
||||
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
|
||||
c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -3832,7 +3819,7 @@ func (c *TableImportRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt,
|
|||
// not slow down the upload operation. This should only be called when
|
||||
// using ResumableMedia (as opposed to Media).
|
||||
func (c *TableImportRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportRowsCall {
|
||||
c.progressUpdater_ = pu
|
||||
c.mediaInfo_.SetProgressUpdater(pu)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -3872,27 +3859,16 @@ func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) {
|
|||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/import")
|
||||
if c.media_ != nil || c.mediaBuffer_ != nil {
|
||||
if c.mediaInfo_ != nil {
|
||||
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
|
||||
protocol := "multipart"
|
||||
if c.mediaBuffer_ != nil {
|
||||
protocol = "resumable"
|
||||
}
|
||||
c.urlParams_.Set("uploadType", protocol)
|
||||
c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
|
||||
}
|
||||
if body == nil {
|
||||
body = new(bytes.Buffer)
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
}
|
||||
if c.media_ != nil {
|
||||
combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
|
||||
defer combined.Close()
|
||||
reqHeaders.Set("Content-Type", ctype)
|
||||
body = combined
|
||||
}
|
||||
if c.mediaBuffer_ != nil && c.mediaType_ != "" {
|
||||
reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
|
||||
}
|
||||
body, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
|
||||
defer cleanup()
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
|
@ -3928,20 +3904,10 @@ func (c *TableImportRowsCall) Do(opts ...googleapi.CallOption) (*Import, error)
|
|||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.mediaBuffer_ != nil {
|
||||
loc := res.Header.Get("Location")
|
||||
rx := &gensupport.ResumableUpload{
|
||||
Client: c.s.client,
|
||||
UserAgent: c.s.userAgent(),
|
||||
URI: loc,
|
||||
Media: c.mediaBuffer_,
|
||||
MediaType: c.mediaType_,
|
||||
Callback: func(curr int64) {
|
||||
if c.progressUpdater_ != nil {
|
||||
c.progressUpdater_(curr, c.mediaSize_)
|
||||
}
|
||||
},
|
||||
}
|
||||
rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
|
||||
if rx != nil {
|
||||
rx.Client = c.s.client
|
||||
rx.UserAgent = c.s.userAgent()
|
||||
ctx := c.ctx_
|
||||
if ctx == nil {
|
||||
ctx = context.TODO()
|
||||
|
@ -4039,15 +4005,11 @@ func (c *TableImportRowsCall) Do(opts ...googleapi.CallOption) (*Import, error)
|
|||
// method id "fusiontables.table.importTable":
|
||||
|
||||
type TableImportTableCall struct {
|
||||
s *Service
|
||||
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
|
||||
header_ http.Header
|
||||
s *Service
|
||||
urlParams_ gensupport.URLParams
|
||||
mediaInfo_ *gensupport.MediaInfo
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// ImportTable: Imports a new table.
|
||||
|
@ -4082,12 +4044,7 @@ func (c *TableImportTableCall) Encoding(encoding string) *TableImportTableCall {
|
|||
// supplied.
|
||||
// At most one of Media and ResumableMedia may be set.
|
||||
func (c *TableImportTableCall) Media(r io.Reader, options ...googleapi.MediaOption) *TableImportTableCall {
|
||||
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)
|
||||
c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4102,11 +4059,7 @@ func (c *TableImportTableCall) Media(r io.Reader, options ...googleapi.MediaOpti
|
|||
// supersede any context previously provided to the Context method.
|
||||
func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TableImportTableCall {
|
||||
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
|
||||
c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4115,7 +4068,7 @@ func (c *TableImportTableCall) ResumableMedia(ctx context.Context, r io.ReaderAt
|
|||
// not slow down the upload operation. This should only be called when
|
||||
// using ResumableMedia (as opposed to Media).
|
||||
func (c *TableImportTableCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableImportTableCall {
|
||||
c.progressUpdater_ = pu
|
||||
c.mediaInfo_.SetProgressUpdater(pu)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4155,27 +4108,16 @@ func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) {
|
|||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/import")
|
||||
if c.media_ != nil || c.mediaBuffer_ != nil {
|
||||
if c.mediaInfo_ != nil {
|
||||
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
|
||||
protocol := "multipart"
|
||||
if c.mediaBuffer_ != nil {
|
||||
protocol = "resumable"
|
||||
}
|
||||
c.urlParams_.Set("uploadType", protocol)
|
||||
c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
|
||||
}
|
||||
if body == nil {
|
||||
body = new(bytes.Buffer)
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
}
|
||||
if c.media_ != nil {
|
||||
combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
|
||||
defer combined.Close()
|
||||
reqHeaders.Set("Content-Type", ctype)
|
||||
body = combined
|
||||
}
|
||||
if c.mediaBuffer_ != nil && c.mediaType_ != "" {
|
||||
reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
|
||||
}
|
||||
body, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
|
||||
defer cleanup()
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
|
@ -4208,20 +4150,10 @@ func (c *TableImportTableCall) Do(opts ...googleapi.CallOption) (*Table, error)
|
|||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.mediaBuffer_ != nil {
|
||||
loc := res.Header.Get("Location")
|
||||
rx := &gensupport.ResumableUpload{
|
||||
Client: c.s.client,
|
||||
UserAgent: c.s.userAgent(),
|
||||
URI: loc,
|
||||
Media: c.mediaBuffer_,
|
||||
MediaType: c.mediaType_,
|
||||
Callback: func(curr int64) {
|
||||
if c.progressUpdater_ != nil {
|
||||
c.progressUpdater_(curr, c.mediaSize_)
|
||||
}
|
||||
},
|
||||
}
|
||||
rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
|
||||
if rx != nil {
|
||||
rx.Client = c.s.client
|
||||
rx.UserAgent = c.s.userAgent()
|
||||
ctx := c.ctx_
|
||||
if ctx == nil {
|
||||
ctx = context.TODO()
|
||||
|
@ -4739,16 +4671,12 @@ func (c *TablePatchCall) Do(opts ...googleapi.CallOption) (*Table, error) {
|
|||
// 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
|
||||
header_ http.Header
|
||||
s *Service
|
||||
tableId string
|
||||
urlParams_ gensupport.URLParams
|
||||
mediaInfo_ *gensupport.MediaInfo
|
||||
ctx_ context.Context
|
||||
header_ http.Header
|
||||
}
|
||||
|
||||
// ReplaceRows: Replaces rows of an existing table. Current rows remain
|
||||
|
@ -4810,12 +4738,7 @@ func (c *TableReplaceRowsCall) StartLine(startLine int64) *TableReplaceRowsCall
|
|||
// 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)
|
||||
c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4830,11 +4753,7 @@ func (c *TableReplaceRowsCall) Media(r io.Reader, options ...googleapi.MediaOpti
|
|||
// 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
|
||||
c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4843,7 +4762,7 @@ func (c *TableReplaceRowsCall) ResumableMedia(ctx context.Context, r io.ReaderAt
|
|||
// not slow down the upload operation. This should only be called when
|
||||
// using ResumableMedia (as opposed to Media).
|
||||
func (c *TableReplaceRowsCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TableReplaceRowsCall {
|
||||
c.progressUpdater_ = pu
|
||||
c.mediaInfo_.SetProgressUpdater(pu)
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -4883,27 +4802,16 @@ func (c *TableReplaceRowsCall) doRequest(alt string) (*http.Response, error) {
|
|||
var body io.Reader = nil
|
||||
c.urlParams_.Set("alt", alt)
|
||||
urls := googleapi.ResolveRelative(c.s.BasePath, "tables/{tableId}/replace")
|
||||
if c.media_ != nil || c.mediaBuffer_ != nil {
|
||||
if c.mediaInfo_ != nil {
|
||||
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
|
||||
protocol := "multipart"
|
||||
if c.mediaBuffer_ != nil {
|
||||
protocol = "resumable"
|
||||
}
|
||||
c.urlParams_.Set("uploadType", protocol)
|
||||
c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
|
||||
}
|
||||
if body == nil {
|
||||
body = new(bytes.Buffer)
|
||||
reqHeaders.Set("Content-Type", "application/json")
|
||||
}
|
||||
if c.media_ != nil {
|
||||
combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
|
||||
defer combined.Close()
|
||||
reqHeaders.Set("Content-Type", ctype)
|
||||
body = combined
|
||||
}
|
||||
if c.mediaBuffer_ != nil && c.mediaType_ != "" {
|
||||
reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
|
||||
}
|
||||
body, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
|
||||
defer cleanup()
|
||||
urls += "?" + c.urlParams_.Encode()
|
||||
req, _ := http.NewRequest("POST", urls, body)
|
||||
req.Header = reqHeaders
|
||||
|
@ -4939,20 +4847,10 @@ func (c *TableReplaceRowsCall) Do(opts ...googleapi.CallOption) (*Task, error) {
|
|||
if err := googleapi.CheckResponse(res); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if c.mediaBuffer_ != nil {
|
||||
loc := res.Header.Get("Location")
|
||||
rx := &gensupport.ResumableUpload{
|
||||
Client: c.s.client,
|
||||
UserAgent: c.s.userAgent(),
|
||||
URI: loc,
|
||||
Media: c.mediaBuffer_,
|
||||
MediaType: c.mediaType_,
|
||||
Callback: func(curr int64) {
|
||||
if c.progressUpdater_ != nil {
|
||||
c.progressUpdater_(curr, c.mediaSize_)
|
||||
}
|
||||
},
|
||||
}
|
||||
rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
|
||||
if rx != nil {
|
||||
rx.Client = c.s.client
|
||||
rx.UserAgent = c.s.userAgent()
|
||||
ctx := c.ctx_
|
||||
if ctx == nil {
|
||||
ctx = context.TODO()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue