本文整理汇总了Golang中google/golang.org/api/googleapi.CloseBody函数的典型用法代码示例。如果您正苦于以下问题:Golang CloseBody函数的具体用法?Golang CloseBody怎么用?Golang CloseBody使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CloseBody函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Do
func (c *ProjectsCreateCall) Do() (*Project, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Project
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a project resource. Initially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage.",
// "httpMethod": "POST",
// "id": "cloudresourcemanager.projects.create",
// "path": "v1beta1/projects",
// "request": {
// "$ref": "Project"
// },
// "response": {
// "$ref": "Project"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
开发者ID:peterkshultz,项目名称:google-api-go-client,代码行数:31,代码来源:cloudresourcemanager-gen.go
示例2: Do
func (c *AccountsListCall) Do() (*AccountsList, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *AccountsList
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the authenticated user's list of accounts.",
// "httpMethod": "GET",
// "id": "adexchangebuyer.accounts.list",
// "path": "accounts",
// "response": {
// "$ref": "AccountsList"
// },
// "scopes": [
// "https://www.googleapis.com/auth/adexchange.buyer"
// ]
// }
}
开发者ID:80nashi,项目名称:google-api-go-client,代码行数:28,代码来源:adexchangebuyer-gen.go
示例3: Do
func (c *UrlInsertCall) Do() (*Url, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Url
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a new short URL.",
// "httpMethod": "POST",
// "id": "urlshortener.url.insert",
// "path": "url",
// "request": {
// "$ref": "Url"
// },
// "response": {
// "$ref": "Url"
// },
// "scopes": [
// "https://www.googleapis.com/auth/urlshortener"
// ]
// }
}
开发者ID:80nashi,项目名称:google-api-go-client,代码行数:31,代码来源:urlshortener-gen.go
示例4: Do
func (c *WebfontsListCall) Do() (*WebfontList, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["sort"]; ok {
params.Set("sort", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "webfonts")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *WebfontList
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves the list of fonts currently served by the Google Fonts Developer API",
// "httpMethod": "GET",
// "id": "webfonts.webfonts.list",
// "parameters": {
// "sort": {
// "description": "Enables sorting of the list",
// "enum": [
// "alpha",
// "date",
// "popularity",
// "style",
// "trending"
// ],
// "enumDescriptions": [
// "Sort alphabetically",
// "Sort by date added",
// "Sort by popularity",
// "Sort by number of styles",
// "Sort by trending"
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "webfonts",
// "response": {
// "$ref": "WebfontList"
// }
// }
}
开发者ID:avinash-,项目名称:google-api-go-client,代码行数:60,代码来源:webfonts-gen.go
示例5: Do
// Do executes the "oauth2.getCertForOpenIdConnect" call.
func (c *GetCertForOpenIdConnectCall) Do(opts ...googleapi.CallOption) (map[string]string, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret map[string]string
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "httpMethod": "GET",
// "id": "oauth2.getCertForOpenIdConnect",
// "path": "oauth2/v1/certs",
// "response": {
// "$ref": "X509"
// }
// }
}
开发者ID:markose,项目名称:google-api-go-client,代码行数:26,代码来源:oauth2-gen.go
示例6: Do
// Do executes the "appstate.states.delete" call.
func (c *StatesDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.",
// "httpMethod": "DELETE",
// "id": "appstate.states.delete",
// "parameterOrder": [
// "stateKey"
// ],
// "parameters": {
// "stateKey": {
// "description": "The key for the data to be retrieved.",
// "format": "int32",
// "location": "path",
// "maximum": "3",
// "minimum": "0",
// "required": true,
// "type": "integer"
// }
// },
// "path": "states/{stateKey}",
// "scopes": [
// "https://www.googleapis.com/auth/appstate"
// ]
// }
}
开发者ID:rctl,项目名称:google-api-go-client,代码行数:36,代码来源:appstate-gen.go
示例7: Do
func (c *PagesGetCall) Do() (*Page, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "blogs/{blogId}/pages/{pageId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"blogId": c.blogId,
"pageId": c.pageId,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Page
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets one blog page by id.",
// "httpMethod": "GET",
// "id": "blogger.pages.get",
// "parameterOrder": [
// "blogId",
// "pageId"
// ],
// "parameters": {
// "blogId": {
// "description": "ID of the blog containing the page.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "pageId": {
// "description": "The ID of the page to get.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "blogs/{blogId}/pages/{pageId}",
// "response": {
// "$ref": "Page"
// },
// "scopes": [
// "https://www.googleapis.com/auth/blogger"
// ]
// }
}
开发者ID:GamerockSA,项目名称:dex,代码行数:60,代码来源:blogger-gen.go
示例8: Do
func (c *GetCertForOpenIdConnectRawCall) Do() (*Raw, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v1/raw_public_keys")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Raw
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "httpMethod": "GET",
// "id": "oauth2.getCertForOpenIdConnectRaw",
// "path": "oauth2/v1/raw_public_keys",
// "response": {
// "$ref": "Raw"
// }
// }
}
开发者ID:avinash-,项目名称:google-api-go-client,代码行数:35,代码来源:oauth2-gen.go
示例9: Do
func (c *ProjectsZonesClustersListCall) Do() (*ListClustersResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
"zone": c.zone,
})
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ListClustersResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all clusters owned by a project in either the specified zone or all zones.",
// "httpMethod": "GET",
// "id": "container.projects.zones.clusters.list",
// "parameterOrder": [
// "projectId",
// "zone"
// ],
// "parameters": {
// "projectId": {
// "description": "The Google Developers Console [project ID](https://console.developers.google.com/project) or [project number](https://developers.google.com/console/help/project-number)",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "zone": {
// "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or \"-\" for all zones.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/projects/{projectId}/zones/{zone}/clusters",
// "response": {
// "$ref": "ListClustersResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
开发者ID:johndmulhausen,项目名称:kubernetes,代码行数:60,代码来源:container-gen.go
示例10: Do
func (c *TemplatesGetCall) Do() (*Template, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/templates/{templateName}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
"templateName": c.templateName,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Template
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "",
// "httpMethod": "GET",
// "id": "manager.templates.get",
// "parameterOrder": [
// "projectId",
// "templateName"
// ],
// "parameters": {
// "projectId": {
// "location": "path",
// "required": true,
// "type": "string"
// },
// "templateName": {
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{projectId}/templates/{templateName}",
// "response": {
// "$ref": "Template"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.cloudman",
// "https://www.googleapis.com/auth/ndev.cloudman.readonly"
// ]
// }
}
开发者ID:avinash-,项目名称:google-api-go-client,代码行数:60,代码来源:manager-gen.go
示例11: Do
func (c *ElectionsElectionQueryCall) Do() (*ElectionsQueryResponse, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ElectionsQueryResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "List of available elections to query.",
// "httpMethod": "GET",
// "id": "civicinfo.elections.electionQuery",
// "path": "elections",
// "response": {
// "$ref": "ElectionsQueryResponse"
// }
// }
}
开发者ID:peterkshultz,项目名称:google-api-go-client,代码行数:25,代码来源:civicinfo-gen.go
示例12: Do
// Do executes the "prediction.trainedmodels.delete" call.
func (c *TrainedmodelsDeleteCall) Do(opts ...googleapi.CallOption) error {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Delete a trained model.",
// "httpMethod": "DELETE",
// "id": "prediction.trainedmodels.delete",
// "parameterOrder": [
// "id"
// ],
// "parameters": {
// "id": {
// "description": "The unique name for the predictive model.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "trainedmodels/{id}",
// "scopes": [
// "https://www.googleapis.com/auth/prediction"
// ]
// }
}
开发者ID:Celluliodio,项目名称:flannel,代码行数:34,代码来源:prediction-gen.go
示例13: Do
func (c *ProjectsZonesOperationsListCall) Do() (*ListOperationsResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{projectId}/zones/{zoneId}/operations")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
"zoneId": c.zoneId,
})
req.Header.Set("User-Agent", c.s.userAgent())
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ListOperationsResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Lists all operations in a project in a specific zone.",
// "httpMethod": "GET",
// "id": "container.projects.zones.operations.list",
// "parameterOrder": [
// "projectId",
// "zoneId"
// ],
// "parameters": {
// "projectId": {
// "description": "The Google Developers Console project ID or project number.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "zoneId": {
// "description": "The name of the Google Compute Engine zone to return operations for.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{projectId}/zones/{zoneId}/operations",
// "response": {
// "$ref": "ListOperationsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
开发者ID:nguansak,项目名称:google-api-go-client,代码行数:60,代码来源:container-gen.go
示例14: Do
func (c *TripsSearchCall) Do() (*TripsSearchResponse, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *TripsSearchResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Returns a list of flights.",
// "httpMethod": "POST",
// "id": "qpxExpress.trips.search",
// "path": "search",
// "request": {
// "$ref": "TripsSearchRequest"
// },
// "response": {
// "$ref": "TripsSearchResponse"
// }
// }
}
开发者ID:80nashi,项目名称:google-api-go-client,代码行数:28,代码来源:qpxexpress-gen.go
示例15: Do
func (c *UserinfoV2MeGetCall) Do() (*Userinfoplus, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Userinfoplus
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get user info",
// "httpMethod": "GET",
// "id": "oauth2.userinfo.v2.me.get",
// "path": "userinfo/v2/me",
// "response": {
// "$ref": "Userinfoplus"
// },
// "scopes": [
// "https://www.googleapis.com/auth/plus.login",
// "https://www.googleapis.com/auth/plus.me",
// "https://www.googleapis.com/auth/userinfo.email",
// "https://www.googleapis.com/auth/userinfo.profile"
// ]
// }
}
开发者ID:vichetuc,项目名称:google-api-go-client,代码行数:31,代码来源:oauth2-gen.go
示例16: Do
// Do executes the "prediction.training.delete" call.
func (c *TrainingDeleteCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Delete a trained model",
// "httpMethod": "DELETE",
// "id": "prediction.training.delete",
// "parameterOrder": [
// "data"
// ],
// "parameters": {
// "data": {
// "description": "mybucket/mydata resource in Google Storage",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "training/{data}",
// "scopes": [
// "https://www.googleapis.com/auth/prediction"
// ]
// }
}
开发者ID:ryanharper,项目名称:google-api-go-client,代码行数:33,代码来源:prediction-gen.go
示例17: Do
func (c *BatchReportsListCall) Do() (*BatchReportList, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
params.Set("batchReportDefinitionId", fmt.Sprintf("%v", c.batchReportDefinitionId))
params.Set("onBehalfOfContentOwner", fmt.Sprintf("%v", c.onBehalfOfContentOwner))
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "batchReports")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *BatchReportList
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a list of processed batch reports.",
// "httpMethod": "GET",
// "id": "youtubeAnalytics.batchReports.list",
// "parameterOrder": [
// "batchReportDefinitionId",
// "onBehalfOfContentOwner"
// ],
// "parameters": {
// "batchReportDefinitionId": {
// "description": "The batchReportDefinitionId parameter specifies the ID of the batch reportort definition for which you are retrieving reports.",
// "location": "query",
// "required": true,
// "type": "string"
// },
// "onBehalfOfContentOwner": {
// "description": "The onBehalfOfContentOwner parameter identifies the content owner that the user is acting on behalf of.",
// "location": "query",
// "required": true,
// "type": "string"
// }
// },
// "path": "batchReports",
// "response": {
// "$ref": "BatchReportList"
// },
// "scopes": [
// "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
// "https://www.googleapis.com/auth/yt-analytics.readonly"
// ]
// }
}
开发者ID:avinash-,项目名称:google-api-go-client,代码行数:60,代码来源:youtubeanalytics-gen.go
示例18: Do
func (c *TransfersInsertCall) Do() (*DataTransfer, error) {
res, err := c.doRequest("json")
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *DataTransfer
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Inserts a data transfer request.",
// "httpMethod": "POST",
// "id": "datatransfer.transfers.insert",
// "path": "transfers",
// "request": {
// "$ref": "DataTransfer"
// },
// "response": {
// "$ref": "DataTransfer"
// },
// "scopes": [
// "https://www.googleapis.com/auth/admin.datatransfer"
// ]
// }
}
开发者ID:vichetuc,项目名称:google-api-go-client,代码行数:31,代码来源:admin-gen.go
示例19: Do
// Do executes the "analytics.management.goals.list" call.
func (c *ManagementGoalsListCall) Do() error {
res, err := c.doRequest("json")
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Lists goals to which the user has access.",
// "httpMethod": "GET",
// "id": "analytics.management.goals.list",
// "parameterOrder": [
// "accountId",
// "webPropertyId",
// "profileId"
// ],
// "parameters": {
// "accountId": {
// "description": "Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "max-results": {
// "description": "The maximum number of goals to include in this response.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "profileId": {
// "description": "View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "start-index": {
// "description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
// "format": "int32",
// "location": "query",
// "minimum": "1",
// "type": "integer"
// },
// "webPropertyId": {
// "description": "Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
// "scopes": [
// "https://www.googleapis.com/auth/analytics",
// "https://www.googleapis.com/auth/analytics.readonly"
// ]
// }
}
开发者ID:HWWSEO,项目名称:google-api-go-client,代码行数:61,代码来源:analytics-gen.go
示例20: Do
// Do executes the "cloudtrace.projects.traces.get" call.
// Exactly one of *Trace or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Trace.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 *ProjectsTracesGetCall) Do() (*Trace, error) {
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 := &Trace{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Gets one trace by id.",
// "httpMethod": "GET",
// "id": "cloudtrace.projects.traces.get",
// "parameterOrder": [
// "projectId",
// "traceId"
// ],
// "parameters": {
// "projectId": {
// "description": "The project id of the trace to return.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "traceId": {
// "description": "The trace id of the trace to return.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/projects/{projectId}/traces/{traceId}",
// "response": {
// "$ref": "Trace"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
开发者ID:davidnguyenwm,项目名称:google-api-go-client,代码行数:67,代码来源:cloudtrace-gen.go
注:本文中的google/golang.org/api/googleapi.CloseBody函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论