本文整理匯總了Golang中code/google/com/p/google-api-go-client/googleapi.SetOpaque函數的典型用法代碼示例。如果您正苦於以下問題:Golang SetOpaque函數的具體用法?Golang SetOpaque怎麽用?Golang SetOpaque使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SetOpaque函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Do
func (c *CreativesListCall) Do() (*CreativesList, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
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 *CreativesList
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a list of the authenticated user's active creatives.",
// "httpMethod": "GET",
// "id": "adexchangebuyer.creatives.list",
// "parameters": {
// "maxResults": {
// "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
// "format": "uint32",
// "location": "query",
// "maximum": "1000",
// "minimum": "1",
// "type": "integer"
// },
// "pageToken": {
// "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "creatives",
// "response": {
// "$ref": "CreativesList"
// },
// "scopes": [
// "https://www.googleapis.com/auth/adexchange.buyer"
// ]
// }
}
示例2: Do
func (c *QueriesListqueriesCall) Do() (*ListQueriesResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "queries")
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
}
ret := new(ListQueriesResponse)
if err := json.NewDecoder(res.Body).Decode(ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves stored queries.",
// "httpMethod": "GET",
// "id": "doubleclickbidmanager.queries.listqueries",
// "path": "queries",
// "response": {
// "$ref": "ListQueriesResponse"
// }
// }
}
示例3: Do
func (c *RelyingpartyGetPublicKeysCall) Do() (map[string]string, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "publicKeys")
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 map[string]string
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Get token signing public key.",
// "httpMethod": "GET",
// "id": "identitytoolkit.relyingparty.getPublicKeys",
// "path": "publicKeys",
// "response": {
// "$ref": "IdentitytoolkitRelyingpartyGetPublicKeysResponse"
// }
// }
}
示例4: Do
func (c *CurrentLocationDeleteCall) Do() error {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative("https://www.googleapis.com/latitude/v1/", "currentLocation")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", 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 err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Deletes the authenticated user's current location.",
// "httpMethod": "DELETE",
// "id": "latitude.currentLocation.delete",
// "path": "currentLocation",
// "scopes": [
// "https://www.googleapis.com/auth/latitude.all.best",
// "https://www.googleapis.com/auth/latitude.all.city",
// "https://www.googleapis.com/auth/latitude.current.best",
// "https://www.googleapis.com/auth/latitude.current.city"
// ]
// }
}
示例5: 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"
// ]
// }
}
示例6: 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"
// }
// }
}
示例7: Do
func (c *ElectionsElectionQueryCall) Do() (*ElectionsQueryResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "elections")
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
}
ret := new(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"
// }
// }
}
示例8: Do
func (c *TrainedmodelsInsertCall) Do() (*Insert2, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.insert)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/trainedmodels")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{project}", url.QueryEscape(c.project), 1)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
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 *Insert2
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Train a Prediction API model.",
// "httpMethod": "POST",
// "id": "prediction.trainedmodels.insert",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "The project associated with the model.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/trainedmodels",
// "request": {
// "$ref": "Insert"
// },
// "response": {
// "$ref": "Insert2"
// },
// "scopes": [
// "https://www.googleapis.com/auth/devstorage.full_control",
// "https://www.googleapis.com/auth/devstorage.read_only",
// "https://www.googleapis.com/auth/devstorage.read_write",
// "https://www.googleapis.com/auth/prediction"
// ]
// }
}
示例9: Do
func (c *RoomsResetCall) Do() error {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/reset")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", 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 err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Reset all rooms for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application.",
// "httpMethod": "POST",
// "id": "gamesManagement.rooms.reset",
// "path": "rooms/reset",
// "scopes": [
// "https://www.googleapis.com/auth/games",
// "https://www.googleapis.com/auth/plus.login"
// ]
// }
}
示例10: Do
func (c *TasklistsListCall) Do() (*TaskLists, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "users/@me/lists")
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 *TaskLists
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Returns all the authenticated user's task lists.",
// "httpMethod": "GET",
// "id": "tasks.tasklists.list",
// "parameters": {
// "maxResults": {
// "description": "Maximum number of task lists returned on one page. Optional. The default is 100.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "pageToken": {
// "description": "Token specifying the result page to return. Optional.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "users/@me/lists",
// "response": {
// "$ref": "TaskLists"
// },
// "scopes": [
// "https://www.googleapis.com/auth/tasks",
// "https://www.googleapis.com/auth/tasks.readonly"
// ]
// }
}
示例11: Do
func (c *TrainedmodelsListCall) Do() (*List, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "trainedmodels/list")
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 *List
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "List available models.",
// "httpMethod": "GET",
// "id": "prediction.trainedmodels.list",
// "parameters": {
// "maxResults": {
// "description": "Maximum number of results to return",
// "format": "uint32",
// "location": "query",
// "minimum": "0",
// "type": "integer"
// },
// "pageToken": {
// "description": "Pagination token",
// "location": "query",
// "type": "string"
// }
// },
// "path": "trainedmodels/list",
// "response": {
// "$ref": "List"
// },
// "scopes": [
// "https://www.googleapis.com/auth/prediction"
// ]
// }
}
示例12: Do
func (c *StatesClearCall) Do() (*WriteResult, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["currentDataVersion"]; ok {
params.Set("currentDataVersion", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}/clear")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{stateKey}", strconv.FormatInt(c.stateKey, 10), 1)
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 *WriteResult
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.",
// "httpMethod": "POST",
// "id": "appstate.states.clear",
// "parameterOrder": [
// "stateKey"
// ],
// "parameters": {
// "currentDataVersion": {
// "description": "The version of the data to be cleared. Version strings are returned by the server.",
// "location": "query",
// "type": "string"
// },
// "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}/clear",
// "response": {
// "$ref": "WriteResult"
// },
// "scopes": [
// "https://www.googleapis.com/auth/appstate"
// ]
// }
}
示例13: Do
func (c *ReportsGetCall) Do() (*Report, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{profileId}", strconv.FormatInt(c.profileId, 10), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{reportId}", strconv.FormatInt(c.reportId, 10), 1)
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 *Report
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Retrieves a report by its id.",
// "httpMethod": "GET",
// "id": "dfareporting.reports.get",
// "parameterOrder": [
// "profileId",
// "reportId"
// ],
// "parameters": {
// "profileId": {
// "description": "The DFA user profile id.",
// "format": "int64",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "reportId": {
// "description": "The id of the report.",
// "format": "int64",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "userprofiles/{profileId}/reports/{reportId}",
// "response": {
// "$ref": "Report"
// },
// "scopes": [
// "https://www.googleapis.com/auth/dfareporting"
// ]
// }
}
示例14: Do
func (c *CustomersInsertCall) Do() (*Customer, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["customerAuthToken"]; ok {
params.Set("customerAuthToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "customers")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
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 *Customer
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates a customer resource if one does not already exist.",
// "httpMethod": "POST",
// "id": "reseller.customers.insert",
// "parameters": {
// "customerAuthToken": {
// "description": "An auth token needed for inserting a customer for which domain already exists. Can be generated at https://www.google.com/a/cpanel//TransferToken. Optional.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "customers",
// "request": {
// "$ref": "Customer"
// },
// "response": {
// "$ref": "Customer"
// },
// "scopes": [
// "https://www.googleapis.com/auth/apps.order"
// ]
// }
}
示例15: Do
func (c *ZoneViewsDeleteCall) Do() error {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
req.URL.Path = strings.Replace(req.URL.Path, "{projectName}", url.QueryEscape(c.projectName), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{zone}", url.QueryEscape(c.zone), 1)
req.URL.Path = strings.Replace(req.URL.Path, "{resourceViewName}", url.QueryEscape(c.resourceViewName), 1)
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 err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Delete a resource view.",
// "httpMethod": "DELETE",
// "id": "resourceviews.zoneViews.delete",
// "parameterOrder": [
// "projectName",
// "zone",
// "resourceViewName"
// ],
// "parameters": {
// "projectName": {
// "description": "The project name of the resource view.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "resourceViewName": {
// "description": "The name of the resource view.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "zone": {
// "description": "The zone name of the resource view.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}",
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.cloudman"
// ]
// }
}