Skip to content

Commit

Permalink
google-api-go-client: rollback commits due to licensing issues
Browse files Browse the repository at this point in the history
This reverts the following commits:
googleapis@661ac69
googleapis@fd68af8
googleapis@b036f29

Change-Id: I2b45d76c69bb97617cef44c71386e4ba5587e8c5
Reviewed-on: https://code-review.googlesource.com/3701
Reviewed-by: Dave Day <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
gmlewis authored and okdave committed Dec 10, 2015
1 parent ece7143 commit a5fc36f
Show file tree
Hide file tree
Showing 27 changed files with 104 additions and 71 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
Alain Vongsouvanhalainv <[email protected]>
Andrew Gerrand <[email protected]>
Brad Fitzpatrick <[email protected]>
Dragoslav Mitrinovic <[email protected]>
Eric Koleda <[email protected]>
Francesc Campoy <[email protected]>
Garrick Evans <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion admin/email_migration/v2/admin-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ func (c *MailInsertCall) doRequest(alt string) (*http.Response, error) {
"userKey": c.userKey,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion analytics/v3/analytics-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -13392,11 +13392,12 @@ func (c *ManagementUploadsUploadDataCall) doRequest(alt string) (*http.Response,
"customDataSourceId": c.customDataSourceId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
9 changes: 6 additions & 3 deletions androidpublisher/v2/androidpublisher-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3229,11 +3229,12 @@ func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) {
"editId": c.editId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -4325,11 +4326,12 @@ func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, e
"expansionFileType": c.expansionFileType,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -5045,11 +5047,12 @@ func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) {
"imageType": c.imageType,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion bigquery/v2/bigquery-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3483,11 +3483,12 @@ func (c *JobsInsertCall) doRequest(alt string) (*http.Response, error) {
"projectId": c.projectId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion dfareporting/v2.0/dfareporting-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -17433,11 +17433,12 @@ func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error)
"advertiserId": strconv.FormatInt(c.advertiserId, 10),
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion dfareporting/v2.1/dfareporting-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -18898,11 +18898,12 @@ func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error)
"advertiserId": strconv.FormatInt(c.advertiserId, 10),
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion dfareporting/v2.2/dfareporting-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -18922,11 +18922,12 @@ func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error)
"advertiserId": strconv.FormatInt(c.advertiserId, 10),
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion dfareporting/v2.3/dfareporting-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -18942,11 +18942,12 @@ func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error)
"advertiserId": strconv.FormatInt(c.advertiserId, 10),
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
6 changes: 4 additions & 2 deletions drive/v1/drive-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,12 @@ func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) {
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -934,11 +935,12 @@ func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) {
"id": c.id,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
9 changes: 6 additions & 3 deletions drive/v2/drive-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -5449,11 +5449,12 @@ func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) {
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -6717,11 +6718,12 @@ func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) {
"fileId": c.fileId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -9583,11 +9585,12 @@ func (c *RealtimeUpdateCall) doRequest(alt string) (*http.Response, error) {
"fileId": c.fileId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
6 changes: 4 additions & 2 deletions fusiontables/v1/fusiontables-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3255,11 +3255,12 @@ func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) {
"tableId": c.tableId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -3498,11 +3499,12 @@ func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) {
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
9 changes: 6 additions & 3 deletions fusiontables/v2/fusiontables-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3316,11 +3316,12 @@ func (c *TableImportRowsCall) doRequest(alt string) (*http.Response, error) {
"tableId": c.tableId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -3559,11 +3560,12 @@ func (c *TableImportTableCall) doRequest(alt string) (*http.Response, error) {
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -4193,11 +4195,12 @@ func (c *TableReplaceRowsCall) doRequest(alt string) (*http.Response, error) {
"tableId": c.tableId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion gamesconfiguration/v1configuration/gamesconfiguration-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,12 @@ func (c *ImageConfigurationsUploadCall) doRequest(alt string) (*http.Response, e
"imageType": c.imageType,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
18 changes: 12 additions & 6 deletions gmail/v1/gmail-gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -1315,11 +1315,12 @@ func (c *UsersDraftsCreateCall) doRequest(alt string) (*http.Response, error) {
"userId": c.userId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -1947,11 +1948,12 @@ func (c *UsersDraftsSendCall) doRequest(alt string) (*http.Response, error) {
"userId": c.userId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -2164,11 +2166,12 @@ func (c *UsersDraftsUpdateCall) doRequest(alt string) (*http.Response, error) {
"id": c.id,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -3635,11 +3638,12 @@ func (c *UsersMessagesImportCall) doRequest(alt string) (*http.Response, error)
"userId": c.userId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -3903,11 +3907,12 @@ func (c *UsersMessagesInsertCall) doRequest(alt string) (*http.Response, error)
"userId": c.userId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down Expand Up @@ -4461,11 +4466,12 @@ func (c *UsersMessagesSendCall) doRequest(alt string) (*http.Response, error) {
"userId": c.userId,
})
if c.protocol_ == "resumable" {
req.ContentLength = 0
if c.mediaType_ == "" {
c.mediaType_ = googleapi.DetectMediaType(c.resumable_)
}
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
req.Header.Set("Content-Type", "application/json; charset=utf-8")
req.Body = nil
} else {
req.Header.Set("Content-Type", ctype)
}
Expand Down
3 changes: 2 additions & 1 deletion google-api-go-generator/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -1800,11 +1800,12 @@ func (meth *Method) generateCode() {

if meth.supportsMediaUpload() {
pn(`if c.protocol_ == "resumable" {`)
pn(" req.ContentLength = 0")
pn(` if c.mediaType_ == "" {`)
pn(" c.mediaType_ = googleapi.DetectMediaType(c.resumable_)")
pn(" }")
pn(` req.Header.Set("X-Upload-Content-Type", c.mediaType_)`)
pn(` req.Header.Set("Content-Type", "application/json; charset=utf-8")`)
pn(" req.Body = nil")
pn("} else {")
pn(` req.Header.Set("Content-Type", ctype)`)
pn("}")
Expand Down
Loading

0 comments on commit a5fc36f

Please sign in to comment.