Skip to content

Commit

Permalink
Revert "google-api-go-client: add support for "repeated" params"
Browse files Browse the repository at this point in the history
This reverts commit 69e4926.

Fixes googleapis#110.

Change-Id: I00c32ad2865fa2eef667b2a97261f920317ca6fd
Reviewed-on: https://code-review.googlesource.com/3592
Reviewed-by: Michael McGreevy <[email protected]>
  • Loading branch information
gmlewis authored and mcgreevy committed Oct 15, 2015
1 parent 69e4926 commit e2903ca
Show file tree
Hide file tree
Showing 145 changed files with 77,066 additions and 53,626 deletions.
247 changes: 140 additions & 107 deletions adexchangebuyer/v1.2/adexchangebuyer-gen.go

Large diffs are not rendered by default.

753 changes: 424 additions & 329 deletions adexchangebuyer/v1.3/adexchangebuyer-gen.go

Large diffs are not rendered by default.

1,517 changes: 862 additions & 655 deletions adexchangebuyer/v1.4/adexchangebuyer-gen.go

Large diffs are not rendered by default.

752 changes: 444 additions & 308 deletions adexchangeseller/v1.1/adexchangeseller-gen.go

Large diffs are not rendered by default.

533 changes: 324 additions & 209 deletions adexchangeseller/v1/adexchangeseller-gen.go

Large diffs are not rendered by default.

631 changes: 370 additions & 261 deletions adexchangeseller/v2.0/adexchangeseller-gen.go

Large diffs are not rendered by default.

201 changes: 122 additions & 79 deletions admin/datatransfer/v1/admin-gen.go

Large diffs are not rendered by default.

2,416 changes: 1,417 additions & 999 deletions admin/directory/v1/admin-gen.go

Large diffs are not rendered by default.

80 changes: 44 additions & 36 deletions admin/email_migration/v2/admin-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,40 +129,39 @@ func (s *MailItem) MarshalJSON() ([]byte, error) {
// method id "emailMigration.mail.insert":

type MailInsertCall struct {
s *Service
userKey string
mailitem *MailItem
urlParams_ internal.URLParams
media_ io.Reader
resumable_ googleapi.SizeReaderAt
mediaType_ string
protocol_ string
progressUpdater_ googleapi.ProgressUpdater
ctx_ context.Context
s *Service
userKey string
mailitem *MailItem
opt_ map[string]interface{}
media_ io.Reader
resumable_ googleapi.SizeReaderAt
mediaType_ string
protocol_ string
ctx_ context.Context
}

// Insert: Insert Mail into Google's Gmail backends
func (r *MailService) Insert(userKey string, mailitem *MailItem) *MailInsertCall {
c := &MailInsertCall{s: r.s, urlParams_: make(internal.URLParams)}
c := &MailInsertCall{s: r.s, opt_: make(map[string]interface{})}
c.userKey = userKey
c.mailitem = mailitem
return c
}

// Media specifies the media to upload in a single chunk. At most one of
// Media and ResumableMedia may be set.
// Media specifies the media to upload in a single chunk.
// At most one of Media and ResumableMedia may be set.
func (c *MailInsertCall) Media(r io.Reader) *MailInsertCall {
c.media_ = r
c.protocol_ = "multipart"
return c
}

// ResumableMedia specifies the media to upload in chunks and can be
// canceled with ctx. 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.
// ResumableMedia specifies the media to upload in chunks and can be canceled with ctx.
// 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 *MailInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MailInsertCall {
c.ctx_ = ctx
c.resumable_ = io.NewSectionReader(r, 0, size)
Expand All @@ -171,28 +170,27 @@ func (c *MailInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, 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
// using ResumableMedia (as opposed to Media).
// 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 using ResumableMedia (as opposed to Media).
func (c *MailInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MailInsertCall {
c.progressUpdater_ = pu
c.opt_["progressUpdater"] = pu
return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *MailInsertCall) Fields(s ...googleapi.Field) *MailInsertCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
c.opt_["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.
// This context will supersede any context previously provided to the
// ResumableMedia method.
// 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.
// This context will supersede any context previously provided to
// the ResumableMedia method.
func (c *MailInsertCall) Context(ctx context.Context) *MailInsertCall {
c.ctx_ = ctx
return c
Expand All @@ -205,13 +203,17 @@ func (c *MailInsertCall) doRequest(alt string) (*http.Response, error) {
return nil, err
}
ctype := "application/json"
c.urlParams_.Set("alt", alt)
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{userKey}/mail")
if c.media_ != nil || c.resumable_ != nil {
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
c.urlParams_.Set("uploadType", c.protocol_)
params.Set("uploadType", c.protocol_)
}
urls += "?" + c.urlParams_.Encode()
urls += "?" + params.Encode()
if c.protocol_ != "resumable" {
var cancel func()
cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)
Expand Down Expand Up @@ -249,6 +251,12 @@ func (c *MailInsertCall) Do() error {
if err := googleapi.CheckResponse(res); err != nil {
return err
}
var progressUpdater_ googleapi.ProgressUpdater
if v, ok := c.opt_["progressUpdater"]; ok {
if pu, ok := v.(googleapi.ProgressUpdater); ok {
progressUpdater_ = pu
}
}
if c.protocol_ == "resumable" {
loc := res.Header.Get("Location")
rx := &googleapi.ResumableUpload{
Expand All @@ -258,7 +266,7 @@ func (c *MailInsertCall) Do() error {
Media: c.resumable_,
MediaType: c.mediaType_,
ContentLength: c.resumable_.Size(),
Callback: c.progressUpdater_,
Callback: progressUpdater_,
}
res, err = rx.Upload(c.ctx_)
if err != nil {
Expand Down
Loading

0 comments on commit e2903ca

Please sign in to comment.