Fix godeps

Signed-off-by: Olivier Gambier <olivier@docker.com>
This commit is contained in:
Olivier Gambier 2016-03-21 12:08:47 -07:00
parent 77e69b9cf3
commit 53e3c1d7b2
806 changed files with 431 additions and 1075412 deletions

View file

@ -1,11 +0,0 @@
_obj
_testmain.go
clientid.dat
clientsecret.dat
google-api-go-generator/google-api-go-gen
syntax:glob
*.6
*.8
*~
*.out

View file

@ -1 +0,0 @@
b571b553f8c057cb6952ce817dfb09b6e34a8c0b release

View file

@ -1,13 +0,0 @@
sudo: false
language: go
go:
- 1.4
- tip
install:
- go get -v google.golang.org/api/...
script:
- go test -v google.golang.org/api/...

10
vendor/google.golang.org/api/AUTHORS generated vendored
View file

@ -1,10 +0,0 @@
# This is the official list of authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
# Names should be added to this file as
# Name or Organization <email address>
# The email address is not required for organizations.
# Please keep the list sorted.
Google Inc.

View file

@ -1,484 +0,0 @@
# Contributing to the Google API Go Client
## Master git repo
Our master git repo is https://code.googlesource.com/google-api-go-client
## Pull Requests
We do **NOT** use Github pull requests. We use Gerrit instead
with the same workflow as Go. See below.
## The source tree
Most of this project is auto-generated.
The notable directories which are not auto-generated:
```
google-api-go-generator/ -- the generator itself
googleapi/ -- shared common code, used by auto-generated code
examples/ -- sample code
```
# Contribution Guidelines
## Introduction
This document explains how to contribute changes to the google-api-go-client project.
## Testing redux
You've written and tested your code, but
before sending code out for review, run all the tests for the whole
tree to make sure the changes don't break other packages or programs:
```
$ make cached
$ go test ./...
...
ok google.golang.org/api/google-api-go-generator 0.226s
ok google.golang.org/api/googleapi 0.015s
...
```
Ideally, you will add unit tests to one of the above directories to
demonstrate the changes you are making and include the tests with your
code review.
## Code review
Changes to google-api-go-client must be reviewed before they are submitted,
no matter who makes the change.
A custom git command called `git-codereview`,
discussed below, helps manage the code review process through a Google-hosted
[instance](https://code-review.googlesource.com/) of the code review
system called [Gerrit](https://code.google.com/p/gerrit/).
### Set up authentication for code review
The Git code hosting server and Gerrit code review server both use a Google
Account to authenticate. You therefore need a Google Account to proceed.
(If you can use the account to
[sign in at google.com](https://www.google.com/accounts/Login),
you can use it to sign in to the code review server.)
The email address you use with the code review system
needs to be added to the [`CONTRIBUTORS`](/CONTRIBUTORS) file
with your first code review.
You can [create a Google Account](https://www.google.com/accounts/NewAccount)
associated with any address where you receive email.
Visit the site [code.googlesource.com](https://code.googlesource.com)
and log in using your Google Account.
Click on the "Generate Password" link that appears at the top of the page.
Click the radio button that says "Only `code.googlesource.com`"
to use this authentication token only for the google-api-go-client project.
Further down the page is a box containing commands to install
the authentication cookie in file called `.gitcookies` in your home
directory.
Copy the text for the commands into a Unix shell window to execute it.
That will install the authentication token.
(If you are on a Windows computer, you should instead follow the instructions
in the yellow box to run the command.)
### Register with Gerrit
Now that you have a Google account and the authentication token,
you need to register your account with Gerrit, the code review system.
To do this, visit [golang.org/cl](https://golang.org/cl)
and log in using the same Google Account you used above.
That is all that is required.
### Install the git-codereview command
Now install the `git-codereview` command by running,
```
go get -u golang.org/x/review/git-codereview
```
Make sure `git-codereview` is installed in your shell path, so that the
`git` command can find it. Check that
```
$ git codereview help
```
prints help text, not an error.
Note to Git aficionados: The `git-codereview` command is not required to
upload and manage Gerrit code reviews. For those who prefer plain Git, the text
below gives the Git equivalent of each git-codereview command. If you do use plain
Git, note that you still need the commit hooks that the git-codereview command
configures; those hooks add a Gerrit `Change-Id` line to the commit
message and check that all Go source files have been formatted with gofmt. Even
if you intend to use plain Git for daily work, install the hooks in a new Git
checkout by running `git-codereview hooks`.
### Set up git aliases
The `git-codereview` command can be run directly from the shell
by typing, for instance,
```
$ git codereview sync
```
but it is more convenient to set up aliases for `git-codereview`'s own
subcommands, so that the above becomes,
```
$ git sync
```
The `git-codereview` subcommands have been chosen to be distinct from
Git's own, so it's safe to do so.
The aliases are optional, but in the rest of this document we will assume
they are installed.
To install them, copy this text into your Git configuration file
(usually `.gitconfig` in your home directory):
```
[alias]
change = codereview change
gofmt = codereview gofmt
mail = codereview mail
pending = codereview pending
submit = codereview submit
sync = codereview sync
```
### Understanding the git-codereview command
After installing the `git-codereview` command, you can run
```
$ git codereview help
```
to learn more about its commands.
You can also read the [command documentation](https://godoc.org/golang.org/x/review/git-codereview).
### Switch to the master branch
New changes should
only be made based on the master branch.
Before making a change, make sure you start on the master branch:
```
$ git checkout master
$ git sync
````
(In Git terms, `git sync` runs
`git pull -r`.)
### Make a change
The entire checked-out tree is writable.
Once you have edited files, you must tell Git that they have been modified.
You must also tell Git about any files that are added, removed, or renamed files.
These operations are done with the usual Git commands,
`git add`,
`git rm`,
and
`git mv`.
If you wish to checkpoint your work, or are ready to send the code out for review, run
```
$ git change <branch>
```
from any directory in your google-api-go-client repository to commit the changes so far.
The name `<branch>` is an arbitrary one you choose to identify the
local branch containing your changes.
(In Git terms, `git change <branch>`
runs `git checkout -b branch`,
then `git branch --set-upstream-to origin/master`,
then `git commit`.)
Git will open a change description file in your editor.
(It uses the editor named by the `$EDITOR` environment variable,
`vi` by default.)
The file will look like:
```
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch foo
# Changes not staged for commit:
# modified: editedfile.go
#
```
At the beginning of this file is a blank line; replace it
with a thorough description of your change.
The first line of the change description is conventionally a one-line
summary of the change, prefixed by `google-api-go-client:`,
and is used as the subject for code review mail.
The rest of the
description elaborates and should provide context for the
change and explain what it does.
If there is a helpful reference, mention it here.
After editing, the template might now read:
```
math: improved Sin, Cos and Tan precision for very large arguments
The existing implementation has poor numerical properties for
large arguments, so use the McGillicutty algorithm to improve
accuracy above 1e10.
The algorithm is described at http://wikipedia.org/wiki/McGillicutty_Algorithm
Fixes #54
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch foo
# Changes not staged for commit:
# modified: editedfile.go
#
```
The commented section of the file lists all the modified files in your client.
It is best to keep unrelated changes in different change lists,
so if you see a file listed that should not be included, abort
the command and move that file to a different branch.
The special notation "Fixes #54" associates the change with issue 54 in the
[google-api-go-client issue tracker](https://github.com/google/google-api-go-client/issues/54).
When this change is eventually submitted, the issue
tracker will automatically mark the issue as fixed.
(There are several such conventions, described in detail in the
[GitHub Issue Tracker documentation](https://help.github.com/articles/closing-issues-via-commit-messages/).)
Once you have finished writing the commit message,
save the file and exit the editor.
If you wish to do more editing, re-stage your changes using
`git add`, and then run
```
$ git change
```
to update the change description and incorporate the staged changes. The
change description contains a `Change-Id` line near the bottom,
added by a Git commit hook during the initial
`git change`.
That line is used by Gerrit to match successive uploads of the same change.
Do not edit or delete it.
(In Git terms, `git change` with no branch name
runs `git commit --amend`.)
### Mail the change for review
Once the change is ready, mail it out for review:
```
$ git mail
```
You can specify a reviewer or CC interested parties
using the `-r` or `-cc` options.
Both accept a comma-separated list of email addresses:
```
$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
```
Unless explicitly told otherwise, such as in the discussion leading
up to sending in the change list, please specify
`bradfitz@golang.org`, `gmlewis@google.com`, or
`mcgreevy@golang.org` as a reviewer.
(In Git terms, `git mail` pushes the local committed
changes to Gerrit using `git push origin HEAD:refs/for/master`.)
If your change relates to an open issue, please add a comment to the issue
announcing your proposed fix, including a link to your CL.
The code review server assigns your change an issue number and URL,
which `git mail` will print, something like:
```
remote: New Changes:
remote: https://code-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
```
### Reviewing code
Running `git mail` will send an email to you and the
reviewers asking them to visit the issue's URL and make comments on the change.
When done, the reviewer adds comments through the Gerrit user interface
and clicks "Reply" to send comments back.
You will receive a mail notification when this happens.
You must reply through the web interface.
### Revise and upload
You must respond to review comments through the web interface.
When you have revised the code and are ready for another round of review,
stage those changes and use `git change` to update the
commit.
To send the update change list for another round of review,
run `git mail` again.
The reviewer can comment on the new copy, and the process repeats.
The reviewer approves the change by giving it a positive score
(+1 or +2) and replying `LGTM`: looks good to me.
You can see a list of your pending changes by running
`git pending`, and switch between change branches with
`git change <branch>`.
### Synchronize your client
While you were working, others might have submitted changes to the repository.
To update your local branch, run
```
$ git sync
```
(In git terms, `git sync` runs
`git pull -r`.)
If files you were editing have changed, Git does its best to merge the
remote changes into your local changes.
It may leave some files to merge by hand.
For example, suppose you have edited `sin.go` but
someone else has committed an independent change.
When you run `git sync`,
you will get the (scary-looking) output:
```
$ git sync
Failed to merge in the changes.
Patch failed at 0023 math: improved Sin, Cos and Tan precision for very large arguments
The copy of the patch that failed is found in:
/home/you/repo/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
```
If this happens, run
```
$ git status
```
to see which files failed to merge.
The output will look something like this:
```
rebase in progress; onto a24c3eb
You are currently rebasing branch 'mcgillicutty' on 'a24c3eb'.
(fix conflicts and then run "git rebase --continue")
(use "git rebase --skip" to skip this patch)
(use "git rebase --abort" to check out the original branch)
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
_both modified: sin.go_
```
The only important part in that transcript is the italicized "both modified"
line: Git failed to merge your changes with the conflicting change.
When this happens, Git leaves both sets of edits in the file,
with conflicts marked by `<<<<<<<` and
`>>>>>>>`.
It is now your job to edit the file to combine them.
Continuing the example, searching for those strings in `sin.go`
might turn up:
```
arg = scale(arg)
<<<<<<< HEAD
if arg > 1e9 {
=======
if arg > 1e10 {
>>>>>>> mcgillicutty
largeReduce(arg)
```
Git doesn't show it, but suppose the original text that both edits
started with was 1e8; you changed it to 1e10 and the other change to 1e9,
so the correct answer might now be 1e10. First, edit the section
to remove the markers and leave the correct code:
```
arg = scale(arg)
if arg > 1e10 {
largeReduce(arg)
```
Then tell Git that the conflict is resolved by running
```
$ git add sin.go
```
If you had been editing the file, say for debugging, but do not
care to preserve your changes, you can run
`git reset HEAD sin.go`
to abandon your changes.
Then run `git rebase --continue` to
restore the change commit.
### Reviewing code by others
You can import a change proposed by someone else into your local Git repository.
On the Gerrit review page, click the "Download ▼" link in the upper right
corner, copy the "Checkout" command and run it from your local Git repo.
It should look something like this:
```
$ git fetch https://code.googlesource.com/review refs/changes/21/1221/1 && git checkout FETCH_HEAD
```
To revert, change back to the branch you were working in.
### Submit the change after the review
After the code has been `LGTM`'ed, an approver may
submit it to the master branch using the Gerrit UI.
There is a "Submit" button on the web page for the change
that appears once the change is approved (marked +2).
This checks the change into the repository.
The change description will include a link to the code review,
and the code review will be updated with a link to the change
in the repository.
Since the method used to integrate the changes is "Cherry Pick",
the commit hashes in the repository will be changed by
the submit operation.
### More information
In addition to the information here, the Go community maintains a [CodeReview](https://golang.org/wiki/CodeReview) wiki page.
Feel free to contribute to this page as you learn the review process.
## Contributors
Files in the google-api-go-client repository don't list author names,
both to avoid clutter and to avoid having to keep the lists up to date.
Instead, please add your name to the [`CONTRIBUTORS`](/CONTRIBUTORS)
file as your first code review, keeping the names in sorted order.

View file

@ -1,51 +0,0 @@
# This is the official list of people who can contribute
# (and typically have contributed) code to the repository.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# The submission process automatically checks to make sure
# that people submitting code are listed in this file (by email address).
#
# Names should be added to this file only after verifying that
# the individual or the individual's organization has agreed to
# the appropriate Contributor License Agreement, found here:
#
# https://cla.developers.google.com/about/google-individual
# https://cla.developers.google.com/about/google-corporate
#
# The CLA can be filled out on the web:
#
# https://cla.developers.google.com/
#
# When adding J Random Contributor's name to this file,
# either J's name or J's organization's name should be
# added to the AUTHORS file, depending on whether the
# individual or corporate CLA was used.
# Names should be added to this file like so:
# Name <email address>
#
# An entry with two email addresses specifies that the
# first address should be used in the submit logs and
# that the second address should be recognized as the
# same person when interacting with Rietveld.
# Please keep the list sorted.
Alain Vongsouvanhalainv <alainv@google.com>
Andrew Gerrand <adg@golang.org>
Brad Fitzpatrick <bradfitz@golang.org>
Dragoslav Mitrinovic <drago@motorola.com>
Eric Koleda <ekoleda+devrel@googlers.com>
Francesc Campoy <campoy@golang.org>
Garrick Evans <garrick@google.com>
Glenn Lewis <gmlewis@google.com>
Ivan Krasin <krasin@golang.org>
Jason Hall <jasonhall@google.com>
Johan Euphrosine <proppy@google.com>
Kostik Shtoyk <kostik@google.com>
Michael McGreevy <mcgreevy@golang.org>
Nick Craig-Wood <nickcw@gmail.com>
Scott Van Woudenberg <scottvw@google.com>
Takashi Matsuo <tmatsuo@google.com>

View file

@ -1,122 +0,0 @@
# Getting Started with the Google APIs for Go
## Getting Started
This is a quick walk-through of how to get started with the Google APIs for Go.
## Background
The first thing to understand is that the Google API libraries are auto-generated for
each language, including Go, so they may not feel like 100% natural for any language.
The Go versions are pretty natural, but please forgive any small non-idiomatic things.
(Suggestions welcome, though!)
## Installing
Pick an API and a version of that API to install.
You can find the complete list by looking at the
[directories here](https://github.com/google/google-api-go-client/tree/master/).
For example, let's install the
[urlshortener's version 1 API](https://godoc.org/google.golang.org/api/urlshortener/v1):
```
$ go get google.golang.org/api/urlshortener/v1
```
Now it's ready for use in your code.
## Using
Once you've installed a library, you import it like this:
```go
package main
import (
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/urlshortener/v1"
)
```
The package name, if you don't override it on your import line, is the name of the
API without the version number. In the case above, just `urlshortener`.
## Instantiating
Each API has a `New` function taking an `*http.Client` and returning an API-specific `*Service`.
You create the service like:
```go
svc, err := urlshortener.New(httpClient)
```
## OAuth HTTP Client
The HTTP client you pass in to the service must be one that automatically adds
Google-supported Authorization information to the requests.
The best option is to use "golang.org/x/oauth2", an OAuth2 library for Go.
You can see how to set up and use oauth2 with these APIs by checking out the
[example code](https://github.com/google/google-api-go-client/tree/master/examples).
In summary, you need to create an OAuth config:
```go
var config = &oauth2.Config{
ClientID: "", // from https://console.developers.google.com/project/<your-project-id>/apiui/credential
ClientSecret: "", // from https://console.developers.google.com/project/<your-project-id>/apiui/credential
Endpoint: google.Endpoint,
Scopes: []string{urlshortener.UrlshortenerScope},
}
```
Then you need to get an OAuth Token from the user. This involves sending the user
to a URL (at Google) to grant access to your application (either a web application
or a desktop application), and then the browser redirects to the website or local
application's webserver with the per-user token in the URL.
Once you have that token,
```go
httpClient := newOAuthClient(context.Background(), config)
```
Then you're good to pass that client to the API's `New` function.
## Using API Keys
Some APIs require passing API keys from your application.
To do this, you can use
[transport.APIKey](http://godoc.org/google.golang.org/api/googleapi/transport#APIKey):
```go
ctx = context.WithValue(context.Background(), oauth2.HTTPClient, &http.Client{
Transport: &transport.APIKey{Key: developerKey},
})
httpClient := newOAuthClient(ctx, config)
```
## Using the Service
Each service contains zero or more methods and zero or more sub-services.
The sub-services related to a specific type of "Resource".
Those sub-services then contain their own methods.
For instance, the urlshortener API has just the "Url" sub-service:
```go
url, err := svc.Url.Get(shortURL).Do()
if err != nil {
...
}
fmt.Printf("The URL %s goes to %s\n", shortURL, url.LongUrl)
```
For a more complete example, see
[urlshortener.go](https://github.com/google/google-api-go-client/tree/master/examples/urlshortener.go)
in the [examples directory](https://github.com/google/google-api-go-client/tree/master/examples/).

View file

@ -1,27 +0,0 @@
API_JSON = $(wildcard */*/*-api.json)
# Download all API specifications and rebuild Go bindings.
# All downloaded files are cached in $TMPDIR for reuse with 'cached' below.
all: generator
$(GOPATH)/bin/google-api-go-generator -cache=false -install -api=*
# Reuse cached API specifications in $TMPDIR and rebuild Go bindings.
cached: generator
$(GOPATH)/bin/google-api-go-generator -cache=true -install -api=*
# Only rebuild Go bindings, do not modify API specifications.
# For every existing */*/*-api.json file, */*/*-gen.go will be built.
local: $(API_JSON:-api.json=-gen.go)
# Pattern rule for the 'local' target.
# Translates otherwise unnamed targets with a -gen.go suffix into the
# matching input file with a -api.json suffix. $< is the input file.
%-gen.go: %-api.json generator
$(GOPATH)/bin/google-api-go-generator -api_json_file=$<
# Rebuild and install $(GOPATH)/bin/google-api-go-generator
generator:
go install google.golang.org/api/googleapi
go install google.golang.org/api/google-api-go-generator
.PHONY: all cached local generator

13
vendor/google.golang.org/api/NOTES generated vendored
View file

@ -1,13 +0,0 @@
Discovery Service:
https://developers.google.com/discovery/
https://developers.google.com/discovery/v1/reference/
The "type" key:
http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
The "format" key:
http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23
https://developers.google.com/discovery/v1/type-format
Google JSON format docs:
http://google-styleguide.googlecode.com/svn/trunk/jsoncstyleguide.xml

View file

@ -1,92 +0,0 @@
# Google APIs Client Library for Go
## Status
[![Build Status](https://travis-ci.org/google/google-api-go-client.png)](https://travis-ci.org/google/google-api-go-client)
These are auto-generated Go libraries from the Google Discovery Service's JSON description files of the available "new style" Google APIs.
Due to the auto-generated nature of this collection of libraries, complete APIs or specific versions can appear or go away without notice.
As a result, you should always locally vendor any API(s) that your code relies upon.
Announcement email:
* http://groups.google.com/group/golang-nuts/browse_thread/thread/6c7281450be9a21e
Getting started documentation:
* https://github.com/google/google-api-go-client/blob/master/GettingStarted.md
In summary:
```
$ go get google.golang.org/api/storage/v1
$ go get google.golang.org/api/tasks/v1
$ go get google.golang.org/api/moderator/v1
... etc ...
```
For docs, see e.g.:
* https://godoc.org/google.golang.org/api/storage/v1
The package of a given import is the second-to-last component, before the version number.
For examples, see:
* https://github.com/google/google-api-go-client/tree/master/examples
For support, use the golang-nuts@ mailing list:
* https://groups.google.com/group/golang-nuts
## Application Default Credentials Example
Application Default Credentials provide a simplified way to obtain credentials
for authenticating with Google APIs.
The Application Default Credentials authenticate as the application itself,
which make them great for working with Google Cloud APIs like Storage or
Datastore. They are the recommended form of authentication when building
applications that run on Google Compute Engine or Google App Engine.
Default credentials are provided by the `golang.org/x/oauth2/google` package. To use them, add the following import:
```
import "golang.org/x/oauth2/google"
```
Some credentials types require you to specify scopes, and service entry points may not inject them. If you encounter this situation you may need to specify scopes as follows:
```
import (
"golang.org/x/net/context"
"golang.org/x/oauth2/google"
"google.golang.org/api/compute/v1"
)
func main() {
// Use oauth2.NoContext if there isn't a good context to pass in.
ctx := context.Background()
client, err := google.DefaultClient(ctx, compute.ComputeScope)
if err != nil {
//...
}
computeService, err := compute.New(client)
if err != nil {
//...
}
}
```
If you need a `oauth2.TokenSource`, use the `DefaultTokenSource` function:
```
ts, err := google.DefaultTokenSource(ctx, scope1, scope2, ...)
if err != nil {
//...
}
client := oauth2.NewClient(ctx, ts)
```
See also: [golang.org/x/oauth2/google](https://godoc.org/golang.org/x/oauth2/google) package documentation.

2
vendor/google.golang.org/api/TODO generated vendored
View file

@ -1,2 +0,0 @@
Moved to:
https://github.com/google/google-api-go-client/issues

View file

@ -1,596 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/NUnz0H_oWow0qcTRC55iG-5RpbM\"",
"discoveryVersion": "v1",
"id": "adexchangebuyer:v1.2",
"name": "adexchangebuyer",
"canonicalName": "Ad Exchange Buyer",
"version": "v1.2",
"revision": "20150909",
"title": "Ad Exchange Buyer API",
"description": "Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/doubleclick-16.gif",
"x32": "https://www.google.com/images/icons/product/doubleclick-32.gif"
},
"documentationLink": "https://developers.google.com/ad-exchange/buyer-rest",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/adexchangebuyer/v1.2/",
"basePath": "/adexchangebuyer/v1.2/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "adexchangebuyer/v1.2/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/adexchange.buyer": {
"description": "Manage your Ad Exchange buyer account configuration"
}
}
}
},
"schemas": {
"Account": {
"id": "Account",
"type": "object",
"description": "Configuration data for an Ad Exchange buyer account.",
"properties": {
"bidderLocation": {
"type": "array",
"description": "Your bidder locations that have distinct URLs.",
"items": {
"type": "object",
"properties": {
"maximumQps": {
"type": "integer",
"description": "The maximum queries per second the Ad Exchange will send.",
"format": "int32"
},
"region": {
"type": "string",
"description": "The geographical region the Ad Exchange should send requests from. Only used by some quota systems, but always setting the value is recommended. Allowed values: \n- ASIA \n- EUROPE \n- US_EAST \n- US_WEST"
},
"url": {
"type": "string",
"description": "The URL to which the Ad Exchange will send bid requests."
}
}
}
},
"cookieMatchingNid": {
"type": "string",
"description": "The nid parameter value used in cookie match requests. Please contact your technical account manager if you need to change this."
},
"cookieMatchingUrl": {
"type": "string",
"description": "The base URL used in cookie match requests."
},
"id": {
"type": "integer",
"description": "Account id.",
"format": "int32"
},
"kind": {
"type": "string",
"description": "Resource type.",
"default": "adexchangebuyer#account"
},
"maximumActiveCreatives": {
"type": "integer",
"description": "The maximum number of active creatives that an account can have, where a creative is active if it was inserted or bid with in the last 30 days. Please contact your technical account manager if you need to change this.",
"format": "int32"
},
"maximumTotalQps": {
"type": "integer",
"description": "The sum of all bidderLocation.maximumQps values cannot exceed this. Please contact your technical account manager if you need to change this.",
"format": "int32"
},
"numberActiveCreatives": {
"type": "integer",
"description": "The number of creatives that this account inserted or bid with in the last 30 days.",
"format": "int32"
}
}
},
"AccountsList": {
"id": "AccountsList",
"type": "object",
"description": "An account feed lists Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single buyer account.",
"properties": {
"items": {
"type": "array",
"description": "A list of accounts.",
"items": {
"$ref": "Account"
}
},
"kind": {
"type": "string",
"description": "Resource type.",
"default": "adexchangebuyer#accountsList"
}
}
},
"Creative": {
"id": "Creative",
"type": "object",
"description": "A creative and its classification data.",
"properties": {
"HTMLSnippet": {
"type": "string",
"description": "The HTML snippet that displays the ad when inserted in the web page. If set, videoURL should not be set."
},
"accountId": {
"type": "integer",
"description": "Account id.",
"format": "int32",
"annotations": {
"required": [
"adexchangebuyer.creatives.insert"
]
}
},
"advertiserId": {
"type": "array",
"description": "Detected advertiser id, if any. Read-only. This field should not be set in requests.",
"items": {
"type": "string",
"format": "int64"
}
},
"advertiserName": {
"type": "string",
"description": "The name of the company being advertised in the creative.",
"annotations": {
"required": [
"adexchangebuyer.creatives.insert"
]
}
},
"agencyId": {
"type": "string",
"description": "The agency id for this creative.",
"format": "int64"
},
"api_upload_timestamp": {
"type": "string",
"description": "The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for uploads. (formatted RFC 3339 timestamp).",
"format": "date-time"
},
"attribute": {
"type": "array",
"description": "All attributes for the ads that may be shown from this snippet.",
"items": {
"type": "integer",
"format": "int32"
}
},
"buyerCreativeId": {
"type": "string",
"description": "A buyer-specific id identifying the creative in this ad.",
"annotations": {
"required": [
"adexchangebuyer.creatives.insert"
]
}
},
"clickThroughUrl": {
"type": "array",
"description": "The set of destination urls for the snippet.",
"items": {
"type": "string"
},
"annotations": {
"required": [
"adexchangebuyer.creatives.insert"
]
}
},
"corrections": {
"type": "array",
"description": "Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests.",
"items": {
"type": "object",
"properties": {
"details": {
"type": "array",
"description": "Additional details about the correction.",
"items": {
"type": "string"
}
},
"reason": {
"type": "string",
"description": "The type of correction that was applied to the creative."
}
}
}
},
"disapprovalReasons": {
"type": "array",
"description": "The reasons for disapproval, if any. Note that not all disapproval reasons may be categorized, so it is possible for the creative to have a status of DISAPPROVED with an empty list for disapproval_reasons. In this case, please reach out to your TAM to help debug the issue. Read-only. This field should not be set in requests.",
"items": {
"type": "object",
"properties": {
"details": {
"type": "array",
"description": "Additional details about the reason for disapproval.",
"items": {
"type": "string"
}
},
"reason": {
"type": "string",
"description": "The categorized reason for disapproval."
}
}
}
},
"filteringReasons": {
"type": "object",
"description": "The filtering reasons for the creative. Read-only. This field should not be set in requests.",
"properties": {
"date": {
"type": "string",
"description": "The date in ISO 8601 format for the data. The data is collected from 00:00:00 to 23:59:59 in PST."
},
"reasons": {
"type": "array",
"description": "The filtering reasons.",
"items": {
"type": "object",
"properties": {
"filteringCount": {
"type": "string",
"description": "The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange.",
"format": "int64"
},
"filteringStatus": {
"type": "integer",
"description": "The filtering status code. Please refer to the creative-status-codes.txt file for different statuses.",
"format": "int32"
}
}
}
}
}
},
"height": {
"type": "integer",
"description": "Ad height.",
"format": "int32",
"annotations": {
"required": [
"adexchangebuyer.creatives.insert"
]
}
},
"impressionTrackingUrl": {
"type": "array",
"description": "The set of urls to be called to record an impression.",
"items": {
"type": "string"
}
},
"kind": {
"type": "string",
"description": "Resource type.",
"default": "adexchangebuyer#creative"
},
"productCategories": {
"type": "array",
"description": "Detected product categories, if any. Read-only. This field should not be set in requests.",
"items": {
"type": "integer",
"format": "int32"
}
},
"restrictedCategories": {
"type": "array",
"description": "All restricted categories for the ads that may be shown from this snippet.",
"items": {
"type": "integer",
"format": "int32"
}
},
"sensitiveCategories": {
"type": "array",
"description": "Detected sensitive categories, if any. Read-only. This field should not be set in requests.",
"items": {
"type": "integer",
"format": "int32"
}
},
"status": {
"type": "string",
"description": "Creative serving status. Read-only. This field should not be set in requests."
},
"vendorType": {
"type": "array",
"description": "All vendor types for the ads that may be shown from this snippet.",
"items": {
"type": "integer",
"format": "int32"
}
},
"version": {
"type": "integer",
"description": "The version for this creative. Read-only. This field should not be set in requests.",
"format": "int32"
},
"videoURL": {
"type": "string",
"description": "The url to fetch a video ad. If set, HTMLSnippet should not be set."
},
"width": {
"type": "integer",
"description": "Ad width.",
"format": "int32",
"annotations": {
"required": [
"adexchangebuyer.creatives.insert"
]
}
}
}
},
"CreativesList": {
"id": "CreativesList",
"type": "object",
"description": "The creatives feed lists the active creatives for the Ad Exchange buyer accounts that the user has access to. Each entry in the feed corresponds to a single creative.",
"properties": {
"items": {
"type": "array",
"description": "A list of creatives.",
"items": {
"$ref": "Creative"
}
},
"kind": {
"type": "string",
"description": "Resource type.",
"default": "adexchangebuyer#creativesList"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token used to page through creatives. To retrieve the next page of results, set the next request's \"pageToken\" value to this."
}
}
}
},
"resources": {
"accounts": {
"methods": {
"get": {
"id": "adexchangebuyer.accounts.get",
"path": "accounts/{id}",
"httpMethod": "GET",
"description": "Gets one account by ID.",
"parameters": {
"id": {
"type": "integer",
"description": "The account id",
"required": true,
"format": "int32",
"location": "path"
}
},
"parameterOrder": [
"id"
],
"response": {
"$ref": "Account"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
},
"list": {
"id": "adexchangebuyer.accounts.list",
"path": "accounts",
"httpMethod": "GET",
"description": "Retrieves the authenticated user's list of accounts.",
"response": {
"$ref": "AccountsList"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
},
"patch": {
"id": "adexchangebuyer.accounts.patch",
"path": "accounts/{id}",
"httpMethod": "PATCH",
"description": "Updates an existing account. This method supports patch semantics.",
"parameters": {
"id": {
"type": "integer",
"description": "The account id",
"required": true,
"format": "int32",
"location": "path"
}
},
"parameterOrder": [
"id"
],
"request": {
"$ref": "Account"
},
"response": {
"$ref": "Account"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
},
"update": {
"id": "adexchangebuyer.accounts.update",
"path": "accounts/{id}",
"httpMethod": "PUT",
"description": "Updates an existing account.",
"parameters": {
"id": {
"type": "integer",
"description": "The account id",
"required": true,
"format": "int32",
"location": "path"
}
},
"parameterOrder": [
"id"
],
"request": {
"$ref": "Account"
},
"response": {
"$ref": "Account"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
}
}
},
"creatives": {
"methods": {
"get": {
"id": "adexchangebuyer.creatives.get",
"path": "creatives/{accountId}/{buyerCreativeId}",
"httpMethod": "GET",
"description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.",
"parameters": {
"accountId": {
"type": "integer",
"description": "The id for the account that will serve this creative.",
"required": true,
"format": "int32",
"location": "path"
},
"buyerCreativeId": {
"type": "string",
"description": "The buyer-specific id for this creative.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"accountId",
"buyerCreativeId"
],
"response": {
"$ref": "Creative"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
},
"insert": {
"id": "adexchangebuyer.creatives.insert",
"path": "creatives",
"httpMethod": "POST",
"description": "Submit a new creative.",
"request": {
"$ref": "Creative"
},
"response": {
"$ref": "Creative"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
},
"list": {
"id": "adexchangebuyer.creatives.list",
"path": "creatives",
"httpMethod": "GET",
"description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.",
"parameters": {
"maxResults": {
"type": "integer",
"description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
"format": "uint32",
"minimum": "1",
"maximum": "1000",
"location": "query"
},
"pageToken": {
"type": "string",
"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"
},
"statusFilter": {
"type": "string",
"description": "When specified, only creatives having the given status are returned.",
"enum": [
"approved",
"disapproved",
"not_checked"
],
"enumDescriptions": [
"Creatives which have been approved.",
"Creatives which have been disapproved.",
"Creatives whose status is not yet checked."
],
"location": "query"
}
},
"response": {
"$ref": "CreativesList"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.buyer"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,918 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/kgKc4O1bceVftsMmf3p1OXF57gg\"",
"discoveryVersion": "v1",
"id": "adexchangeseller:v1",
"name": "adexchangeseller",
"canonicalName": "Ad Exchange Seller",
"version": "v1",
"revision": "20141112",
"title": "Ad Exchange Seller API",
"description": "Gives Ad Exchange seller users access to their inventory and the ability to generate reports",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/doubleclick-16.gif",
"x32": "https://www.google.com/images/icons/product/doubleclick-32.gif"
},
"documentationLink": "https://developers.google.com/ad-exchange/seller-rest/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/adexchangeseller/v1/",
"basePath": "/adexchangeseller/v1/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "adexchangeseller/v1/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"csv",
"json"
],
"enumDescriptions": [
"Responses with Content-Type of text/csv",
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/adexchange.seller": {
"description": "View and manage your Ad Exchange data"
},
"https://www.googleapis.com/auth/adexchange.seller.readonly": {
"description": "View your Ad Exchange data"
}
}
}
},
"schemas": {
"AdClient": {
"id": "AdClient",
"type": "object",
"properties": {
"arcOptIn": {
"type": "boolean",
"description": "Whether this ad client is opted in to ARC."
},
"id": {
"type": "string",
"description": "Unique identifier of this ad client."
},
"kind": {
"type": "string",
"description": "Kind of resource this is, in this case adexchangeseller#adClient.",
"default": "adexchangeseller#adClient"
},
"productCode": {
"type": "string",
"description": "This ad client's product code, which corresponds to the PRODUCT_CODE report dimension."
},
"supportsReporting": {
"type": "boolean",
"description": "Whether this ad client supports being reported on."
}
}
},
"AdClients": {
"id": "AdClients",
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of this response for caching purposes."
},
"items": {
"type": "array",
"description": "The ad clients returned in this list response.",
"items": {
"$ref": "AdClient"
}
},
"kind": {
"type": "string",
"description": "Kind of list this is, in this case adexchangeseller#adClients.",
"default": "adexchangeseller#adClients"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's \"pageToken\" value to this."
}
}
},
"AdUnit": {
"id": "AdUnit",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Identity code of this ad unit, not necessarily unique across ad clients."
},
"id": {
"type": "string",
"description": "Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format."
},
"kind": {
"type": "string",
"description": "Kind of resource this is, in this case adexchangeseller#adUnit.",
"default": "adexchangeseller#adUnit"
},
"name": {
"type": "string",
"description": "Name of this ad unit."
},
"status": {
"type": "string",
"description": "Status of this ad unit. Possible values are:\nNEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it.\n\nACTIVE: Indicates that there has been activity on this ad unit in the last seven days.\n\nINACTIVE: Indicates that there has been no activity on this ad unit in the last seven days."
}
}
},
"AdUnits": {
"id": "AdUnits",
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of this response for caching purposes."
},
"items": {
"type": "array",
"description": "The ad units returned in this list response.",
"items": {
"$ref": "AdUnit"
}
},
"kind": {
"type": "string",
"description": "Kind of list this is, in this case adexchangeseller#adUnits.",
"default": "adexchangeseller#adUnits"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token used to page through ad units. To retrieve the next page of results, set the next request's \"pageToken\" value to this."
}
}
},
"CustomChannel": {
"id": "CustomChannel",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Code of this custom channel, not necessarily unique across ad clients."
},
"id": {
"type": "string",
"description": "Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format."
},
"kind": {
"type": "string",
"description": "Kind of resource this is, in this case adexchangeseller#customChannel.",
"default": "adexchangeseller#customChannel"
},
"name": {
"type": "string",
"description": "Name of this custom channel."
},
"targetingInfo": {
"type": "object",
"description": "The targeting information of this custom channel, if activated.",
"properties": {
"adsAppearOn": {
"type": "string",
"description": "The name used to describe this channel externally."
},
"description": {
"type": "string",
"description": "The external description of the channel."
},
"location": {
"type": "string",
"description": "The locations in which ads appear. (Only valid for content and mobile content ads). Acceptable values for content ads are: TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for mobile content ads are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS."
},
"siteLanguage": {
"type": "string",
"description": "The language of the sites ads will be displayed on."
}
}
}
}
},
"CustomChannels": {
"id": "CustomChannels",
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of this response for caching purposes."
},
"items": {
"type": "array",
"description": "The custom channels returned in this list response.",
"items": {
"$ref": "CustomChannel"
}
},
"kind": {
"type": "string",
"description": "Kind of list this is, in this case adexchangeseller#customChannels.",
"default": "adexchangeseller#customChannels"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's \"pageToken\" value to this."
}
}
},
"Report": {
"id": "Report",
"type": "object",
"properties": {
"averages": {
"type": "array",
"description": "The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.",
"items": {
"type": "string"
}
},
"headers": {
"type": "array",
"description": "The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for each metric in the request.",
"items": {
"type": "object",
"properties": {
"currency": {
"type": "string",
"description": "The currency of this column. Only present if the header type is METRIC_CURRENCY."
},
"name": {
"type": "string",
"description": "The name of the header."
},
"type": {
"type": "string",
"description": "The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY."
}
}
}
},
"kind": {
"type": "string",
"description": "Kind this is, in this case adexchangeseller#report.",
"default": "adexchangeseller#report"
},
"rows": {
"type": "array",
"description": "The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The dimension cells contain strings, and the metric cells contain numbers.",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"totalMatchedRows": {
"type": "string",
"description": "The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or the report row limit.",
"format": "int64"
},
"totals": {
"type": "array",
"description": "The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.",
"items": {
"type": "string"
}
},
"warnings": {
"type": "array",
"description": "Any warnings associated with generation of the report.",
"items": {
"type": "string"
}
}
}
},
"SavedReport": {
"id": "SavedReport",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of this saved report."
},
"kind": {
"type": "string",
"description": "Kind of resource this is, in this case adexchangeseller#savedReport.",
"default": "adexchangeseller#savedReport"
},
"name": {
"type": "string",
"description": "This saved report's name."
}
}
},
"SavedReports": {
"id": "SavedReports",
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of this response for caching purposes."
},
"items": {
"type": "array",
"description": "The saved reports returned in this list response.",
"items": {
"$ref": "SavedReport"
}
},
"kind": {
"type": "string",
"description": "Kind of list this is, in this case adexchangeseller#savedReports.",
"default": "adexchangeseller#savedReports"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's \"pageToken\" value to this."
}
}
},
"UrlChannel": {
"id": "UrlChannel",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format."
},
"kind": {
"type": "string",
"description": "Kind of resource this is, in this case adexchangeseller#urlChannel.",
"default": "adexchangeseller#urlChannel"
},
"urlPattern": {
"type": "string",
"description": "URL Pattern of this URL channel. Does not include \"http://\" or \"https://\". Example: www.example.com/home"
}
}
},
"UrlChannels": {
"id": "UrlChannels",
"type": "object",
"properties": {
"etag": {
"type": "string",
"description": "ETag of this response for caching purposes."
},
"items": {
"type": "array",
"description": "The URL channels returned in this list response.",
"items": {
"$ref": "UrlChannel"
}
},
"kind": {
"type": "string",
"description": "Kind of list this is, in this case adexchangeseller#urlChannels.",
"default": "adexchangeseller#urlChannels"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's \"pageToken\" value to this."
}
}
}
},
"resources": {
"adclients": {
"methods": {
"list": {
"id": "adexchangeseller.adclients.list",
"path": "adclients",
"httpMethod": "GET",
"description": "List all ad clients in this Ad Exchange account.",
"parameters": {
"maxResults": {
"type": "integer",
"description": "The maximum number of ad clients to include in the response, used for paging.",
"format": "uint32",
"minimum": "0",
"maximum": "10000",
"location": "query"
},
"pageToken": {
"type": "string",
"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.",
"location": "query"
}
},
"response": {
"$ref": "AdClients"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
}
},
"adunits": {
"methods": {
"get": {
"id": "adexchangeseller.adunits.get",
"path": "adclients/{adClientId}/adunits/{adUnitId}",
"httpMethod": "GET",
"description": "Gets the specified ad unit in the specified ad client.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client for which to get the ad unit.",
"required": true,
"location": "path"
},
"adUnitId": {
"type": "string",
"description": "Ad unit to retrieve.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"adClientId",
"adUnitId"
],
"response": {
"$ref": "AdUnit"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
},
"list": {
"id": "adexchangeseller.adunits.list",
"path": "adclients/{adClientId}/adunits",
"httpMethod": "GET",
"description": "List all ad units in the specified ad client for this Ad Exchange account.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client for which to list ad units.",
"required": true,
"location": "path"
},
"includeInactive": {
"type": "boolean",
"description": "Whether to include inactive ad units. Default: true.",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of ad units to include in the response, used for paging.",
"format": "uint32",
"minimum": "0",
"maximum": "10000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
"location": "query"
}
},
"parameterOrder": [
"adClientId"
],
"response": {
"$ref": "AdUnits"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
},
"resources": {
"customchannels": {
"methods": {
"list": {
"id": "adexchangeseller.adunits.customchannels.list",
"path": "adclients/{adClientId}/adunits/{adUnitId}/customchannels",
"httpMethod": "GET",
"description": "List all custom channels which the specified ad unit belongs to.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client which contains the ad unit.",
"required": true,
"location": "path"
},
"adUnitId": {
"type": "string",
"description": "Ad unit for which to list custom channels.",
"required": true,
"location": "path"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of custom channels to include in the response, used for paging.",
"format": "uint32",
"minimum": "0",
"maximum": "10000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
"location": "query"
}
},
"parameterOrder": [
"adClientId",
"adUnitId"
],
"response": {
"$ref": "CustomChannels"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
}
}
}
},
"customchannels": {
"methods": {
"get": {
"id": "adexchangeseller.customchannels.get",
"path": "adclients/{adClientId}/customchannels/{customChannelId}",
"httpMethod": "GET",
"description": "Get the specified custom channel from the specified ad client.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client which contains the custom channel.",
"required": true,
"location": "path"
},
"customChannelId": {
"type": "string",
"description": "Custom channel to retrieve.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"adClientId",
"customChannelId"
],
"response": {
"$ref": "CustomChannel"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
},
"list": {
"id": "adexchangeseller.customchannels.list",
"path": "adclients/{adClientId}/customchannels",
"httpMethod": "GET",
"description": "List all custom channels in the specified ad client for this Ad Exchange account.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client for which to list custom channels.",
"required": true,
"location": "path"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of custom channels to include in the response, used for paging.",
"format": "uint32",
"minimum": "0",
"maximum": "10000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
"location": "query"
}
},
"parameterOrder": [
"adClientId"
],
"response": {
"$ref": "CustomChannels"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
},
"resources": {
"adunits": {
"methods": {
"list": {
"id": "adexchangeseller.customchannels.adunits.list",
"path": "adclients/{adClientId}/customchannels/{customChannelId}/adunits",
"httpMethod": "GET",
"description": "List all ad units in the specified custom channel.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client which contains the custom channel.",
"required": true,
"location": "path"
},
"customChannelId": {
"type": "string",
"description": "Custom channel for which to list ad units.",
"required": true,
"location": "path"
},
"includeInactive": {
"type": "boolean",
"description": "Whether to include inactive ad units. Default: true.",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of ad units to include in the response, used for paging.",
"format": "uint32",
"minimum": "0",
"maximum": "10000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
"location": "query"
}
},
"parameterOrder": [
"adClientId",
"customChannelId"
],
"response": {
"$ref": "AdUnits"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
}
}
}
},
"reports": {
"methods": {
"generate": {
"id": "adexchangeseller.reports.generate",
"path": "reports",
"httpMethod": "GET",
"description": "Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
"parameters": {
"dimension": {
"type": "string",
"description": "Dimensions to base the report on.",
"pattern": "[a-zA-Z_]+",
"repeated": true,
"location": "query"
},
"endDate": {
"type": "string",
"description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
"required": true,
"pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
"location": "query"
},
"filter": {
"type": "string",
"description": "Filters to be run on the report.",
"pattern": "[a-zA-Z_]+(==|=@).+",
"repeated": true,
"location": "query"
},
"locale": {
"type": "string",
"description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
"pattern": "[a-zA-Z_]+",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of rows of report data to return.",
"format": "uint32",
"minimum": "0",
"maximum": "50000",
"location": "query"
},
"metric": {
"type": "string",
"description": "Numeric columns to include in the report.",
"pattern": "[a-zA-Z_]+",
"repeated": true,
"location": "query"
},
"sort": {
"type": "string",
"description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.",
"pattern": "(\\+|-)?[a-zA-Z_]+",
"repeated": true,
"location": "query"
},
"startDate": {
"type": "string",
"description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
"required": true,
"pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
"location": "query"
},
"startIndex": {
"type": "integer",
"description": "Index of the first row of report data to return.",
"format": "uint32",
"minimum": "0",
"maximum": "5000",
"location": "query"
}
},
"parameterOrder": [
"startDate",
"endDate"
],
"response": {
"$ref": "Report"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
],
"supportsMediaDownload": true
}
},
"resources": {
"saved": {
"methods": {
"generate": {
"id": "adexchangeseller.reports.saved.generate",
"path": "reports/{savedReportId}",
"httpMethod": "GET",
"description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.",
"parameters": {
"locale": {
"type": "string",
"description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
"pattern": "[a-zA-Z_]+",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of rows of report data to return.",
"format": "int32",
"minimum": "0",
"maximum": "50000",
"location": "query"
},
"savedReportId": {
"type": "string",
"description": "The saved report to retrieve.",
"required": true,
"location": "path"
},
"startIndex": {
"type": "integer",
"description": "Index of the first row of report data to return.",
"format": "int32",
"minimum": "0",
"maximum": "5000",
"location": "query"
}
},
"parameterOrder": [
"savedReportId"
],
"response": {
"$ref": "Report"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
},
"list": {
"id": "adexchangeseller.reports.saved.list",
"path": "reports/saved",
"httpMethod": "GET",
"description": "List all saved reports in this Ad Exchange account.",
"parameters": {
"maxResults": {
"type": "integer",
"description": "The maximum number of saved reports to include in the response, used for paging.",
"format": "int32",
"minimum": "0",
"maximum": "100",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
"location": "query"
}
},
"response": {
"$ref": "SavedReports"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
}
}
}
},
"urlchannels": {
"methods": {
"list": {
"id": "adexchangeseller.urlchannels.list",
"path": "adclients/{adClientId}/urlchannels",
"httpMethod": "GET",
"description": "List all URL channels in the specified ad client for this Ad Exchange account.",
"parameters": {
"adClientId": {
"type": "string",
"description": "Ad client for which to list URL channels.",
"required": true,
"location": "path"
},
"maxResults": {
"type": "integer",
"description": "The maximum number of URL channels to include in the response, used for paging.",
"format": "uint32",
"minimum": "0",
"maximum": "10000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
"location": "query"
}
},
"parameterOrder": [
"adClientId"
],
"response": {
"$ref": "UrlChannels"
},
"scopes": [
"https://www.googleapis.com/auth/adexchange.seller",
"https://www.googleapis.com/auth/adexchange.seller.readonly"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,411 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/fIZK26KtD09fXt5m9JygrSOR194\"",
"discoveryVersion": "v1",
"id": "admin:datatransfer_v1",
"name": "admin",
"canonicalName": "DataTransfer",
"version": "datatransfer_v1",
"revision": "20150917",
"title": "Admin Data Transfer API",
"description": "Admin Data Transfer API lets you transfer user data from one user to another.",
"ownerDomain": "google.com",
"ownerName": "Google",
"packagePath": "admin",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://developers.google.com/admin-sdk/data-transfer/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/admin/datatransfer/v1/",
"basePath": "/admin/datatransfer/v1/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "admin/datatransfer/v1/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/admin.datatransfer": {
"description": "View and manage data transfers between users in your organization"
},
"https://www.googleapis.com/auth/admin.datatransfer.readonly": {
"description": "View data transfers between users in your organization"
}
}
}
},
"schemas": {
"Application": {
"id": "Application",
"type": "object",
"description": "The JSON template for an Application resource.",
"properties": {
"etag": {
"type": "string",
"description": "Etag of the resource."
},
"id": {
"type": "string",
"description": "The application's ID.",
"format": "int64"
},
"kind": {
"type": "string",
"description": "Identifies the resource as a DataTransfer Application Resource.",
"default": "admin#datatransfer#ApplicationResource"
},
"name": {
"type": "string",
"description": "The application's name."
},
"transferParams": {
"type": "array",
"description": "The list of all possible transfer parameters for this application. These parameters can be used to select the data of the user in this application to be transfered.",
"items": {
"$ref": "ApplicationTransferParam"
}
}
}
},
"ApplicationDataTransfer": {
"id": "ApplicationDataTransfer",
"type": "object",
"description": "Template to map fields of ApplicationDataTransfer resource.",
"properties": {
"applicationId": {
"type": "string",
"description": "The application's ID.",
"format": "int64"
},
"applicationTransferParams": {
"type": "array",
"description": "The transfer parameters for the application. These parameters are used to select the data which will get transfered in context of this application.",
"items": {
"$ref": "ApplicationTransferParam"
}
},
"applicationTransferStatus": {
"type": "string",
"description": "Current status of transfer for this application. (Read-only)"
}
}
},
"ApplicationTransferParam": {
"id": "ApplicationTransferParam",
"type": "object",
"description": "Template for application transfer parameters.",
"properties": {
"key": {
"type": "string",
"description": "The type of the transfer parameter. eg: 'PRIVACY_LEVEL'"
},
"value": {
"type": "array",
"description": "The value of the coressponding transfer parameter. eg: 'PRIVATE' or 'SHARED'",
"items": {
"type": "string"
}
}
}
},
"ApplicationsListResponse": {
"id": "ApplicationsListResponse",
"type": "object",
"description": "Template for a collection of Applications.",
"properties": {
"applications": {
"type": "array",
"description": "List of applications that support data transfer and are also installed for the customer.",
"items": {
"$ref": "Application"
}
},
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"kind": {
"type": "string",
"description": "Identifies the resource as a collection of Applications.",
"default": "admin#datatransfer#applicationsList"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token which will be used to specify next page in list API."
}
}
},
"DataTransfer": {
"id": "DataTransfer",
"type": "object",
"description": "The JSON template for a DataTransfer resource.",
"properties": {
"applicationDataTransfers": {
"type": "array",
"description": "List of per application data transfer resources. It contains data transfer details of the applications associated with this transfer resource. Note that this list is also used to specify the applications for which data transfer has to be done at the time of the transfer resource creation.",
"items": {
"$ref": "ApplicationDataTransfer"
}
},
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"id": {
"type": "string",
"description": "The transfer's ID (Read-only)."
},
"kind": {
"type": "string",
"description": "Identifies the resource as a DataTransfer request.",
"default": "admin#datatransfer#DataTransfer"
},
"newOwnerUserId": {
"type": "string",
"description": "ID of the user to whom the data is being transfered."
},
"oldOwnerUserId": {
"type": "string",
"description": "ID of the user whose data is being transfered."
},
"overallTransferStatusCode": {
"type": "string",
"description": "Overall transfer status (Read-only)."
},
"requestTime": {
"type": "string",
"description": "The time at which the data transfer was requested (Read-only).",
"format": "date-time"
}
}
},
"DataTransfersListResponse": {
"id": "DataTransfersListResponse",
"type": "object",
"description": "Template for a collection of DataTransfer resources.",
"properties": {
"dataTransfers": {
"type": "array",
"description": "List of data transfer requests.",
"items": {
"$ref": "DataTransfer"
}
},
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"kind": {
"type": "string",
"description": "Identifies the resource as a collection of data transfer requests.",
"default": "admin#datatransfer#dataTransfersList"
},
"nextPageToken": {
"type": "string",
"description": "Continuation token which will be used to specify next page in list API."
}
}
}
},
"resources": {
"applications": {
"methods": {
"get": {
"id": "datatransfer.applications.get",
"path": "applications/{applicationId}",
"httpMethod": "GET",
"description": "Retrieves information about an application for the given application ID.",
"parameters": {
"applicationId": {
"type": "string",
"description": "ID of the application resource to be retrieved.",
"required": true,
"format": "int64",
"location": "path"
}
},
"parameterOrder": [
"applicationId"
],
"response": {
"$ref": "Application"
},
"scopes": [
"https://www.googleapis.com/auth/admin.datatransfer",
"https://www.googleapis.com/auth/admin.datatransfer.readonly"
]
},
"list": {
"id": "datatransfer.applications.list",
"path": "applications",
"httpMethod": "GET",
"description": "Lists the applications available for data transfer for a customer.",
"parameters": {
"customerId": {
"type": "string",
"description": "Immutable ID of the Google Apps account.",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Maximum number of results to return. Default is 100.",
"format": "uint32",
"minimum": "1",
"maximum": "500",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Token to specify next page in the list.",
"location": "query"
}
},
"response": {
"$ref": "ApplicationsListResponse"
},
"scopes": [
"https://www.googleapis.com/auth/admin.datatransfer",
"https://www.googleapis.com/auth/admin.datatransfer.readonly"
]
}
}
},
"transfers": {
"methods": {
"get": {
"id": "datatransfer.transfers.get",
"path": "transfers/{dataTransferId}",
"httpMethod": "GET",
"description": "Retrieves a data transfer request by its resource ID.",
"parameters": {
"dataTransferId": {
"type": "string",
"description": "ID of the resource to be retrieved. This is returned in the response from the insert method.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"dataTransferId"
],
"response": {
"$ref": "DataTransfer"
},
"scopes": [
"https://www.googleapis.com/auth/admin.datatransfer",
"https://www.googleapis.com/auth/admin.datatransfer.readonly"
]
},
"insert": {
"id": "datatransfer.transfers.insert",
"path": "transfers",
"httpMethod": "POST",
"description": "Inserts a data transfer request.",
"request": {
"$ref": "DataTransfer"
},
"response": {
"$ref": "DataTransfer"
},
"scopes": [
"https://www.googleapis.com/auth/admin.datatransfer"
]
},
"list": {
"id": "datatransfer.transfers.list",
"path": "transfers",
"httpMethod": "GET",
"description": "Lists the transfers for a customer by source user, destination user, or status.",
"parameters": {
"customerId": {
"type": "string",
"description": "Immutable ID of the Google Apps account.",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Maximum number of results to return. Default is 100.",
"format": "int32",
"minimum": "1",
"maximum": "500",
"location": "query"
},
"newOwnerUserId": {
"type": "string",
"description": "Destination user's profile ID.",
"location": "query"
},
"oldOwnerUserId": {
"type": "string",
"description": "Source user's profile ID.",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Token to specify the next page in the list.",
"location": "query"
},
"status": {
"type": "string",
"description": "Status of the transfer.",
"location": "query"
}
},
"response": {
"$ref": "DataTransfersListResponse"
},
"scopes": [
"https://www.googleapis.com/auth/admin.datatransfer",
"https://www.googleapis.com/auth/admin.datatransfer.readonly"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,173 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/_VRzIG5q4_x1FzCCxocLHIuiUhw\"",
"discoveryVersion": "v1",
"id": "admin:email_migration_v2",
"name": "admin",
"version": "email_migration_v2",
"revision": "20150303",
"title": "Email Migration API v2",
"description": "Email Migration API lets you migrate emails of users to Google backends.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/googlemail-16.png",
"x32": "https://www.google.com/images/icons/product/googlemail-32.png"
},
"documentationLink": "https://developers.google.com/admin-sdk/email-migration/v2/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/email/v2/users/",
"basePath": "/email/v2/users/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "email/v2/users/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/email.migration": {
"description": "Manage email messages of users on your domain"
}
}
}
},
"schemas": {
"MailItem": {
"id": "MailItem",
"type": "object",
"description": "JSON template for MailItem object in Email Migration API.",
"properties": {
"isDeleted": {
"type": "boolean",
"description": "Boolean indicating if the mail is deleted (used in Vault)"
},
"isDraft": {
"type": "boolean",
"description": "Boolean indicating if the mail is draft"
},
"isInbox": {
"type": "boolean",
"description": "Boolean indicating if the mail is in inbox"
},
"isSent": {
"type": "boolean",
"description": "Boolean indicating if the mail is in 'sent mails'"
},
"isStarred": {
"type": "boolean",
"description": "Boolean indicating if the mail is starred"
},
"isTrash": {
"type": "boolean",
"description": "Boolean indicating if the mail is in trash"
},
"isUnread": {
"type": "boolean",
"description": "Boolean indicating if the mail is unread"
},
"kind": {
"type": "string",
"description": "Kind of resource this is.",
"default": "mailItem"
},
"labels": {
"type": "array",
"description": "List of labels (strings)",
"items": {
"type": "string"
}
}
}
}
},
"resources": {
"mail": {
"methods": {
"insert": {
"id": "emailMigration.mail.insert",
"path": "{userKey}/mail",
"httpMethod": "POST",
"description": "Insert Mail into Google's Gmail backends",
"parameters": {
"userKey": {
"type": "string",
"description": "The email or immutable id of the user",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"userKey"
],
"request": {
"$ref": "MailItem"
},
"scopes": [
"https://www.googleapis.com/auth/email.migration"
],
"supportsMediaUpload": true,
"mediaUpload": {
"accept": [
"message/rfc822"
],
"maxSize": "35MB",
"protocols": {
"simple": {
"multipart": true,
"path": "/upload/email/v2/users/{userKey}/mail"
},
"resumable": {
"multipart": true,
"path": "/resumable/upload/email/v2/users/{userKey}/mail"
}
}
}
}
}
}
}
}

View file

@ -1,321 +0,0 @@
// Package admin provides access to the Email Migration API v2.
//
// See https://developers.google.com/admin-sdk/email-migration/v2/
//
// Usage example:
//
// import "google.golang.org/api/admin/email_migration/v2"
// ...
// adminService, err := admin.New(oauthHttpClient)
package admin // import "google.golang.org/api/admin/email_migration/v2"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "admin:email_migration_v2"
const apiName = "admin"
const apiVersion = "email_migration_v2"
const basePath = "https://www.googleapis.com/email/v2/users/"
// OAuth2 scopes used by this API.
const (
// Manage email messages of users on your domain
EmailMigrationScope = "https://www.googleapis.com/auth/email.migration"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Mail = NewMailService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Mail *MailService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewMailService(s *Service) *MailService {
rs := &MailService{s: s}
return rs
}
type MailService struct {
s *Service
}
// MailItem: JSON template for MailItem object in Email Migration API.
type MailItem struct {
// IsDeleted: Boolean indicating if the mail is deleted (used in Vault)
IsDeleted bool `json:"isDeleted,omitempty"`
// IsDraft: Boolean indicating if the mail is draft
IsDraft bool `json:"isDraft,omitempty"`
// IsInbox: Boolean indicating if the mail is in inbox
IsInbox bool `json:"isInbox,omitempty"`
// IsSent: Boolean indicating if the mail is in 'sent mails'
IsSent bool `json:"isSent,omitempty"`
// IsStarred: Boolean indicating if the mail is starred
IsStarred bool `json:"isStarred,omitempty"`
// IsTrash: Boolean indicating if the mail is in trash
IsTrash bool `json:"isTrash,omitempty"`
// IsUnread: Boolean indicating if the mail is unread
IsUnread bool `json:"isUnread,omitempty"`
// Kind: Kind of resource this is.
Kind string `json:"kind,omitempty"`
// Labels: List of labels (strings)
Labels []string `json:"labels,omitempty"`
// ForceSendFields is a list of field names (e.g. "IsDeleted") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *MailItem) MarshalJSON() ([]byte, error) {
type noMethod MailItem
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "emailMigration.mail.insert":
type MailInsertCall struct {
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, 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.
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.
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)
c.mediaType_ = mediaType
c.protocol_ = "resumable"
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).
func (c *MailInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MailInsertCall {
c.opt_["progressUpdater"] = pu
return c
}
// 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.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.
func (c *MailInsertCall) Context(ctx context.Context) *MailInsertCall {
c.ctx_ = ctx
return c
}
func (c *MailInsertCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.mailitem)
if err != nil {
return nil, err
}
ctype := "application/json"
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)
params.Set("uploadType", c.protocol_)
}
urls += "?" + params.Encode()
if c.protocol_ != "resumable" {
var cancel func()
cancel, _ = googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)
if cancel != nil {
defer cancel()
}
}
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"userKey": c.userKey,
})
if c.protocol_ == "resumable" {
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")
} else {
req.Header.Set("Content-Type", ctype)
}
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "emailMigration.mail.insert" call.
func (c *MailInsertCall) 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
}
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{
Client: c.s.client,
UserAgent: c.s.userAgent(),
URI: loc,
Media: c.resumable_,
MediaType: c.mediaType_,
ContentLength: c.resumable_.Size(),
Callback: progressUpdater_,
}
res, err = rx.Upload(c.ctx_)
if err != nil {
return err
}
defer res.Body.Close()
}
return nil
// {
// "description": "Insert Mail into Google's Gmail backends",
// "httpMethod": "POST",
// "id": "emailMigration.mail.insert",
// "mediaUpload": {
// "accept": [
// "message/rfc822"
// ],
// "maxSize": "35MB",
// "protocols": {
// "resumable": {
// "multipart": true,
// "path": "/resumable/upload/email/v2/users/{userKey}/mail"
// },
// "simple": {
// "multipart": true,
// "path": "/upload/email/v2/users/{userKey}/mail"
// }
// }
// },
// "parameterOrder": [
// "userKey"
// ],
// "parameters": {
// "userKey": {
// "description": "The email or immutable id of the user",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{userKey}/mail",
// "request": {
// "$ref": "MailItem"
// },
// "scopes": [
// "https://www.googleapis.com/auth/email.migration"
// ],
// "supportsMediaUpload": true
// }
}

View file

@ -1,744 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/lycAHH8x-Ct6oDsJmcDO1AWwIZ4\"",
"discoveryVersion": "v1",
"id": "admin:reports_v1",
"name": "admin",
"canonicalName": "reports",
"version": "reports_v1",
"revision": "20150907",
"title": "Admin Reports API",
"description": "Allows the administrators of Google Apps customers to fetch reports about the usage, collaboration, security and risk for their users.",
"ownerDomain": "google.com",
"ownerName": "Google",
"packagePath": "admin",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://developers.google.com/admin-sdk/reports/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/admin/reports/v1/",
"basePath": "/admin/reports/v1/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "admin/reports/v1/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/admin.reports.audit.readonly": {
"description": "View audit reports of Google Apps for your domain"
},
"https://www.googleapis.com/auth/admin.reports.usage.readonly": {
"description": "View usage reports of Google Apps for your domain"
}
}
}
},
"schemas": {
"Activities": {
"id": "Activities",
"type": "object",
"description": "JSON template for a collection of activites.",
"properties": {
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"items": {
"type": "array",
"description": "Each record in read response.",
"items": {
"$ref": "Activity"
}
},
"kind": {
"type": "string",
"description": "Kind of list response this is.",
"default": "admin#reports#activities"
},
"nextPageToken": {
"type": "string",
"description": "Token for retrieving the next page"
}
}
},
"Activity": {
"id": "Activity",
"type": "object",
"description": "JSON template for the activity resource.",
"properties": {
"actor": {
"type": "object",
"description": "User doing the action.",
"properties": {
"callerType": {
"type": "string",
"description": "User or OAuth 2LO request."
},
"email": {
"type": "string",
"description": "Email address of the user."
},
"key": {
"type": "string",
"description": "For OAuth 2LO API requests, consumer_key of the requestor."
},
"profileId": {
"type": "string",
"description": "Obfuscated user id of the user."
}
}
},
"etag": {
"type": "string",
"description": "ETag of the entry."
},
"events": {
"type": "array",
"description": "Activity events.",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of event."
},
"parameters": {
"type": "array",
"description": "Parameter value pairs for various applications.",
"items": {
"type": "object",
"properties": {
"boolValue": {
"type": "boolean",
"description": "Boolean value of the parameter."
},
"intValue": {
"type": "string",
"description": "Integral value of the parameter.",
"format": "int64"
},
"multiIntValue": {
"type": "array",
"description": "Multi-int value of the parameter.",
"items": {
"type": "string",
"format": "int64"
}
},
"multiValue": {
"type": "array",
"description": "Multi-string value of the parameter.",
"items": {
"type": "string"
}
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"value": {
"type": "string",
"description": "String value of the parameter."
}
}
}
},
"type": {
"type": "string",
"description": "Type of event."
}
}
}
},
"id": {
"type": "object",
"description": "Unique identifier for each activity record.",
"properties": {
"applicationName": {
"type": "string",
"description": "Application name to which the event belongs."
},
"customerId": {
"type": "string",
"description": "Obfuscated customer ID of the source customer."
},
"time": {
"type": "string",
"description": "Time of occurrence of the activity.",
"format": "date-time"
},
"uniqueQualifier": {
"type": "string",
"description": "Unique qualifier if multiple events have the same time.",
"format": "int64"
}
}
},
"ipAddress": {
"type": "string",
"description": "IP Address of the user doing the action."
},
"kind": {
"type": "string",
"description": "Kind of resource this is.",
"default": "admin#reports#activity"
},
"ownerDomain": {
"type": "string",
"description": "Domain of source customer."
}
}
},
"Channel": {
"id": "Channel",
"type": "object",
"description": "An notification channel used to watch for resource changes.",
"properties": {
"address": {
"type": "string",
"description": "The address where notifications are delivered for this channel."
},
"expiration": {
"type": "string",
"description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
"format": "int64"
},
"id": {
"type": "string",
"description": "A UUID or similar unique string that identifies this channel."
},
"kind": {
"type": "string",
"description": "Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string \"api#channel\".",
"default": "api#channel"
},
"params": {
"type": "object",
"description": "Additional parameters controlling delivery channel behavior. Optional.",
"additionalProperties": {
"type": "string",
"description": "Declares a new parameter by name."
}
},
"payload": {
"type": "boolean",
"description": "A Boolean value to indicate whether payload is wanted. Optional."
},
"resourceId": {
"type": "string",
"description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions."
},
"resourceUri": {
"type": "string",
"description": "A version-specific identifier for the watched resource."
},
"token": {
"type": "string",
"description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
},
"type": {
"type": "string",
"description": "The type of delivery mechanism used for this channel."
}
}
},
"UsageReport": {
"id": "UsageReport",
"type": "object",
"description": "JSON template for a usage report.",
"properties": {
"date": {
"type": "string",
"description": "The date to which the record belongs.",
"readOnly": true
},
"entity": {
"type": "object",
"description": "Information about the type of the item.",
"readOnly": true,
"properties": {
"customerId": {
"type": "string",
"description": "Obfuscated customer id for the record.",
"readOnly": true
},
"profileId": {
"type": "string",
"description": "Obfuscated user id for the record.",
"readOnly": true
},
"type": {
"type": "string",
"description": "The type of item, can be a customer or user.",
"readOnly": true
},
"userEmail": {
"type": "string",
"description": "user's email.",
"readOnly": true
}
}
},
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"kind": {
"type": "string",
"description": "The kind of object.",
"default": "admin#reports#usageReport"
},
"parameters": {
"type": "array",
"description": "Parameter value pairs for various applications.",
"readOnly": true,
"items": {
"type": "object",
"properties": {
"boolValue": {
"type": "boolean",
"description": "Boolean value of the parameter.",
"readOnly": true
},
"datetimeValue": {
"type": "string",
"description": "RFC 3339 formatted value of the parameter.",
"format": "date-time",
"readOnly": true
},
"intValue": {
"type": "string",
"description": "Integral value of the parameter.",
"format": "int64",
"readOnly": true
},
"msgValue": {
"type": "array",
"description": "Nested message value of the parameter.",
"readOnly": true,
"items": {
"type": "object",
"additionalProperties": {
"type": "any"
}
}
},
"name": {
"type": "string",
"description": "The name of the parameter."
},
"stringValue": {
"type": "string",
"description": "String value of the parameter.",
"readOnly": true
}
}
}
}
}
},
"UsageReports": {
"id": "UsageReports",
"type": "object",
"description": "JSON template for a collection of usage reports.",
"properties": {
"etag": {
"type": "string",
"description": "ETag of the resource."
},
"kind": {
"type": "string",
"description": "The kind of object.",
"default": "admin#reports#usageReports"
},
"nextPageToken": {
"type": "string",
"description": "Token for retrieving the next page"
},
"usageReports": {
"type": "array",
"description": "Various application parameter records.",
"items": {
"$ref": "UsageReport"
}
},
"warnings": {
"type": "array",
"description": "Warnings if any.",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Machine readable code / warning type."
},
"data": {
"type": "array",
"description": "Key-Value pairs to give detailed information on the warning.",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "Key associated with a key-value pair to give detailed information on the warning."
},
"value": {
"type": "string",
"description": "Value associated with a key-value pair to give detailed information on the warning."
}
}
}
},
"message": {
"type": "string",
"description": "Human readable message for the warning."
}
}
}
}
}
}
},
"resources": {
"activities": {
"methods": {
"list": {
"id": "reports.activities.list",
"path": "activity/users/{userKey}/applications/{applicationName}",
"httpMethod": "GET",
"description": "Retrieves a list of activities for a specific customer and application.",
"parameters": {
"actorIpAddress": {
"type": "string",
"description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.",
"location": "query"
},
"applicationName": {
"type": "string",
"description": "Application name for which the events are to be retrieved.",
"required": true,
"pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)",
"location": "path"
},
"customerId": {
"type": "string",
"description": "Represents the customer for which the data is to be fetched.",
"pattern": "C.+",
"location": "query"
},
"endTime": {
"type": "string",
"description": "Return events which occured at or before this time.",
"pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))",
"location": "query"
},
"eventName": {
"type": "string",
"description": "Name of the event being queried.",
"location": "query"
},
"filters": {
"type": "string",
"description": "Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],...",
"pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Number of activity records to be shown in each page.",
"format": "int32",
"minimum": "1",
"maximum": "1000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Token to specify next page.",
"location": "query"
},
"startTime": {
"type": "string",
"description": "Return events which occured at or after this time.",
"pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))",
"location": "query"
},
"userKey": {
"type": "string",
"description": "Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"userKey",
"applicationName"
],
"response": {
"$ref": "Activities"
},
"scopes": [
"https://www.googleapis.com/auth/admin.reports.audit.readonly"
],
"supportsSubscription": true
},
"watch": {
"id": "reports.activities.watch",
"path": "activity/users/{userKey}/applications/{applicationName}/watch",
"httpMethod": "POST",
"description": "Push changes to activities",
"parameters": {
"actorIpAddress": {
"type": "string",
"description": "IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.",
"location": "query"
},
"applicationName": {
"type": "string",
"description": "Application name for which the events are to be retrieved.",
"required": true,
"pattern": "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)",
"location": "path"
},
"customerId": {
"type": "string",
"description": "Represents the customer for which the data is to be fetched.",
"pattern": "C.+",
"location": "query"
},
"endTime": {
"type": "string",
"description": "Return events which occured at or before this time.",
"pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))",
"location": "query"
},
"eventName": {
"type": "string",
"description": "Name of the event being queried.",
"location": "query"
},
"filters": {
"type": "string",
"description": "Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],...",
"pattern": "(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+,)*(.+[\u003c,\u003c=,==,\u003e=,\u003e,\u003c\u003e].+)",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Number of activity records to be shown in each page.",
"format": "int32",
"minimum": "1",
"maximum": "1000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Token to specify next page.",
"location": "query"
},
"startTime": {
"type": "string",
"description": "Return events which occured at or after this time.",
"pattern": "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))",
"location": "query"
},
"userKey": {
"type": "string",
"description": "Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"userKey",
"applicationName"
],
"request": {
"$ref": "Channel",
"parameterName": "resource"
},
"response": {
"$ref": "Channel"
},
"scopes": [
"https://www.googleapis.com/auth/admin.reports.audit.readonly"
],
"supportsSubscription": true
}
}
},
"channels": {
"methods": {
"stop": {
"id": "admin.channels.stop",
"path": "/admin/reports_v1/channels/stop",
"httpMethod": "POST",
"description": "Stop watching resources through this channel",
"request": {
"$ref": "Channel",
"parameterName": "resource"
},
"scopes": [
"https://www.googleapis.com/auth/admin.reports.audit.readonly"
]
}
}
},
"customerUsageReports": {
"methods": {
"get": {
"id": "reports.customerUsageReports.get",
"path": "usage/dates/{date}",
"httpMethod": "GET",
"description": "Retrieves a report which is a collection of properties / statistics for a specific customer.",
"parameters": {
"customerId": {
"type": "string",
"description": "Represents the customer for which the data is to be fetched.",
"pattern": "C.+",
"location": "query"
},
"date": {
"type": "string",
"description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.",
"required": true,
"pattern": "(\\d){4}-(\\d){2}-(\\d){2}",
"location": "path"
},
"pageToken": {
"type": "string",
"description": "Token to specify next page.",
"location": "query"
},
"parameters": {
"type": "string",
"description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.",
"pattern": "(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+)",
"location": "query"
}
},
"parameterOrder": [
"date"
],
"response": {
"$ref": "UsageReports"
},
"scopes": [
"https://www.googleapis.com/auth/admin.reports.usage.readonly"
]
}
}
},
"userUsageReport": {
"methods": {
"get": {
"id": "reports.userUsageReport.get",
"path": "usage/users/{userKey}/dates/{date}",
"httpMethod": "GET",
"description": "Retrieves a report which is a collection of properties / statistics for a set of users.",
"parameters": {
"customerId": {
"type": "string",
"description": "Represents the customer for which the data is to be fetched.",
"pattern": "C.+",
"location": "query"
},
"date": {
"type": "string",
"description": "Represents the date in yyyy-mm-dd format for which the data is to be fetched.",
"required": true,
"pattern": "(\\d){4}-(\\d){2}-(\\d){2}",
"location": "path"
},
"filters": {
"type": "string",
"description": "Represents the set of filters including parameter operator value.",
"pattern": "(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+[\u003c,\u003c=,==,\u003e=,\u003e,!=].+)",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Maximum number of results to return. Maximum allowed is 1000",
"format": "uint32",
"maximum": "1000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Token to specify next page.",
"location": "query"
},
"parameters": {
"type": "string",
"description": "Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.",
"pattern": "(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+,)*(((accounts)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)):.+)",
"location": "query"
},
"userKey": {
"type": "string",
"description": "Represents the profile id or the user email for which the data should be filtered.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"userKey",
"date"
],
"response": {
"$ref": "UsageReports"
},
"scopes": [
"https://www.googleapis.com/auth/admin.reports.usage.readonly"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,366 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/deWKWLiFywg1_Xne7G92xyJt8HA\"",
"discoveryVersion": "v1",
"id": "analytics:v2.4",
"name": "analytics",
"version": "v2.4",
"revision": "20150115",
"title": "Google Analytics API",
"description": "View and manage your Google Analytics data",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/analytics-16.png",
"x32": "https://www.google.com/images/icons/product/analytics-32.png"
},
"documentationLink": "https://developers.google.com/analytics/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/analytics/v2.4/",
"basePath": "/analytics/v2.4/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "analytics/v2.4/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "atom",
"enum": [
"atom"
],
"enumDescriptions": [
"Responses with Content-Type of application/atom+xml"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "false",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/analytics": {
"description": "View and manage your Google Analytics data"
},
"https://www.googleapis.com/auth/analytics.readonly": {
"description": "View your Google Analytics data"
}
}
}
},
"resources": {
"data": {
"methods": {
"get": {
"id": "analytics.data.get",
"path": "data",
"httpMethod": "GET",
"description": "Returns Analytics report data for a view (profile).",
"parameters": {
"dimensions": {
"type": "string",
"description": "A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.",
"pattern": "(ga:.+)?",
"location": "query"
},
"end-date": {
"type": "string",
"description": "End date for fetching report data. All requests should specify an end date formatted as YYYY-MM-DD.",
"required": true,
"pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
"location": "query"
},
"filters": {
"type": "string",
"description": "A comma-separated list of dimension or metric filters to be applied to the report data.",
"pattern": "ga:.+",
"location": "query"
},
"ids": {
"type": "string",
"description": "Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.",
"required": true,
"pattern": "ga:[0-9]+",
"location": "query"
},
"max-results": {
"type": "integer",
"description": "The maximum number of entries to include in this feed.",
"format": "int32",
"location": "query"
},
"metrics": {
"type": "string",
"description": "A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified to retrieve a valid Analytics report.",
"required": true,
"pattern": "ga:.+",
"location": "query"
},
"segment": {
"type": "string",
"description": "An Analytics advanced segment to be applied to the report data.",
"location": "query"
},
"sort": {
"type": "string",
"description": "A comma-separated list of dimensions or metrics that determine the sort order for the report data.",
"pattern": "(-)?ga:.+",
"location": "query"
},
"start-date": {
"type": "string",
"description": "Start date for fetching report data. All requests should specify a start date formatted as YYYY-MM-DD.",
"required": true,
"pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
"location": "query"
},
"start-index": {
"type": "integer",
"description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
"format": "int32",
"minimum": "1",
"location": "query"
}
},
"parameterOrder": [
"ids",
"start-date",
"end-date",
"metrics"
],
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
},
"management": {
"resources": {
"accounts": {
"methods": {
"list": {
"id": "analytics.management.accounts.list",
"path": "management/accounts",
"httpMethod": "GET",
"description": "Lists all accounts to which the user has access.",
"parameters": {
"max-results": {
"type": "integer",
"description": "The maximum number of accounts to include in this response.",
"format": "int32",
"location": "query"
},
"start-index": {
"type": "integer",
"description": "An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
"format": "int32",
"minimum": "1",
"location": "query"
}
},
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
},
"goals": {
"methods": {
"list": {
"id": "analytics.management.goals.list",
"path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals",
"httpMethod": "GET",
"description": "Lists goals to which the user has access.",
"parameters": {
"accountId": {
"type": "string",
"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.",
"required": true,
"location": "path"
},
"max-results": {
"type": "integer",
"description": "The maximum number of goals to include in this response.",
"format": "int32",
"location": "query"
},
"profileId": {
"type": "string",
"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.",
"required": true,
"location": "path"
},
"start-index": {
"type": "integer",
"description": "An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
"format": "int32",
"minimum": "1",
"location": "query"
},
"webPropertyId": {
"type": "string",
"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.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"accountId",
"webPropertyId",
"profileId"
],
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
},
"profiles": {
"methods": {
"list": {
"id": "analytics.management.profiles.list",
"path": "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles",
"httpMethod": "GET",
"description": "Lists views (profiles) to which the user has access.",
"parameters": {
"accountId": {
"type": "string",
"description": "Account ID for the views (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access.",
"required": true,
"location": "path"
},
"max-results": {
"type": "integer",
"description": "The maximum number of views (profiles) to include in this response.",
"format": "int32",
"location": "query"
},
"start-index": {
"type": "integer",
"description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
"format": "int32",
"minimum": "1",
"location": "query"
},
"webPropertyId": {
"type": "string",
"description": "Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"accountId",
"webPropertyId"
],
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
},
"segments": {
"methods": {
"list": {
"id": "analytics.management.segments.list",
"path": "management/segments",
"httpMethod": "GET",
"description": "Lists advanced segments to which the user has access.",
"parameters": {
"max-results": {
"type": "integer",
"description": "The maximum number of advanced segments to include in this response.",
"format": "int32",
"location": "query"
},
"start-index": {
"type": "integer",
"description": "An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
"format": "int32",
"minimum": "1",
"location": "query"
}
},
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
},
"webproperties": {
"methods": {
"list": {
"id": "analytics.management.webproperties.list",
"path": "management/accounts/{accountId}/webproperties",
"httpMethod": "GET",
"description": "Lists web properties to which the user has access.",
"parameters": {
"accountId": {
"type": "string",
"description": "Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to.",
"required": true,
"location": "path"
},
"max-results": {
"type": "integer",
"description": "The maximum number of web properties to include in this response.",
"format": "int32",
"location": "query"
},
"start-index": {
"type": "integer",
"description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.",
"format": "int32",
"minimum": "1",
"location": "query"
}
},
"parameterOrder": [
"accountId"
],
"scopes": [
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly"
]
}
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,256 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/yLZNoMooQ7qHvZwtvucNfre7PCU\"",
"discoveryVersion": "v1",
"id": "androidpublisher:v1.1",
"name": "androidpublisher",
"canonicalName": "Android Publisher",
"version": "v1.1",
"revision": "20150323",
"title": "Google Play Developer API",
"description": "Lets Android application developers access their Google Play accounts.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/android-16.png",
"x32": "https://www.google.com/images/icons/product/android-32.png"
},
"documentationLink": "https://developers.google.com/android-publisher",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/androidpublisher/v1.1/applications/",
"basePath": "/androidpublisher/v1.1/applications/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "androidpublisher/v1.1/applications/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/androidpublisher": {
"description": "View and manage your Google Play Developer account"
}
}
}
},
"schemas": {
"InappPurchase": {
"id": "InappPurchase",
"type": "object",
"description": "An InappPurchase resource indicates the status of a user's inapp product purchase.",
"properties": {
"consumptionState": {
"type": "integer",
"description": "The consumption state of the inapp product. Possible values are: \n- Yet to be consumed \n- Consumed",
"format": "int32"
},
"developerPayload": {
"type": "string",
"description": "A developer-specified string that contains supplemental information about an order."
},
"kind": {
"type": "string",
"description": "This kind represents an inappPurchase object in the androidpublisher service.",
"default": "androidpublisher#inappPurchase"
},
"purchaseState": {
"type": "integer",
"description": "The purchase state of the order. Possible values are: \n- Purchased \n- Cancelled",
"format": "int32"
},
"purchaseTime": {
"type": "string",
"description": "The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).",
"format": "int64"
}
}
},
"SubscriptionPurchase": {
"id": "SubscriptionPurchase",
"type": "object",
"description": "A SubscriptionPurchase resource indicates the status of a user's subscription purchase.",
"properties": {
"autoRenewing": {
"type": "boolean",
"description": "Whether the subscription will automatically be renewed when it reaches its current expiry time."
},
"initiationTimestampMsec": {
"type": "string",
"description": "Time at which the subscription was granted, in milliseconds since Epoch.",
"format": "int64"
},
"kind": {
"type": "string",
"description": "This kind represents a subscriptionPurchase object in the androidpublisher service.",
"default": "androidpublisher#subscriptionPurchase"
},
"validUntilTimestampMsec": {
"type": "string",
"description": "Time at which the subscription will expire, in milliseconds since Epoch.",
"format": "int64"
}
}
}
},
"resources": {
"inapppurchases": {
"methods": {
"get": {
"id": "androidpublisher.inapppurchases.get",
"path": "{packageName}/inapp/{productId}/purchases/{token}",
"httpMethod": "GET",
"description": "Checks the purchase and consumption status of an inapp item.",
"parameters": {
"packageName": {
"type": "string",
"description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').",
"required": true,
"location": "path"
},
"productId": {
"type": "string",
"description": "The inapp product SKU (for example, 'com.some.thing.inapp1').",
"required": true,
"location": "path"
},
"token": {
"type": "string",
"description": "The token provided to the user's device when the inapp product was purchased.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"packageName",
"productId",
"token"
],
"response": {
"$ref": "InappPurchase"
},
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
}
}
},
"purchases": {
"methods": {
"cancel": {
"id": "androidpublisher.purchases.cancel",
"path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel",
"httpMethod": "POST",
"description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
"parameters": {
"packageName": {
"type": "string",
"description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
"required": true,
"location": "path"
},
"subscriptionId": {
"type": "string",
"description": "The purchased subscription ID (for example, 'monthly001').",
"required": true,
"location": "path"
},
"token": {
"type": "string",
"description": "The token provided to the user's device when the subscription was purchased.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"packageName",
"subscriptionId",
"token"
],
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
},
"get": {
"id": "androidpublisher.purchases.get",
"path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}",
"httpMethod": "GET",
"description": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
"parameters": {
"packageName": {
"type": "string",
"description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
"required": true,
"location": "path"
},
"subscriptionId": {
"type": "string",
"description": "The purchased subscription ID (for example, 'monthly001').",
"required": true,
"location": "path"
},
"token": {
"type": "string",
"description": "The token provided to the user's device when the subscription was purchased.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"packageName",
"subscriptionId",
"token"
],
"response": {
"$ref": "SubscriptionPurchase"
},
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
}
}
}
}
}

View file

@ -1,581 +0,0 @@
// Package androidpublisher provides access to the Google Play Developer API.
//
// See https://developers.google.com/android-publisher
//
// Usage example:
//
// import "google.golang.org/api/androidpublisher/v1.1"
// ...
// androidpublisherService, err := androidpublisher.New(oauthHttpClient)
package androidpublisher // import "google.golang.org/api/androidpublisher/v1.1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "androidpublisher:v1.1"
const apiName = "androidpublisher"
const apiVersion = "v1.1"
const basePath = "https://www.googleapis.com/androidpublisher/v1.1/applications/"
// OAuth2 scopes used by this API.
const (
// View and manage your Google Play Developer account
AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Inapppurchases = NewInapppurchasesService(s)
s.Purchases = NewPurchasesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Inapppurchases *InapppurchasesService
Purchases *PurchasesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewInapppurchasesService(s *Service) *InapppurchasesService {
rs := &InapppurchasesService{s: s}
return rs
}
type InapppurchasesService struct {
s *Service
}
func NewPurchasesService(s *Service) *PurchasesService {
rs := &PurchasesService{s: s}
return rs
}
type PurchasesService struct {
s *Service
}
// InappPurchase: An InappPurchase resource indicates the status of a
// user's inapp product purchase.
type InappPurchase struct {
// ConsumptionState: The consumption state of the inapp product.
// Possible values are:
// - Yet to be consumed
// - Consumed
ConsumptionState int64 `json:"consumptionState,omitempty"`
// DeveloperPayload: A developer-specified string that contains
// supplemental information about an order.
DeveloperPayload string `json:"developerPayload,omitempty"`
// Kind: This kind represents an inappPurchase object in the
// androidpublisher service.
Kind string `json:"kind,omitempty"`
// PurchaseState: The purchase state of the order. Possible values are:
//
// - Purchased
// - Cancelled
PurchaseState int64 `json:"purchaseState,omitempty"`
// PurchaseTime: The time the product was purchased, in milliseconds
// since the epoch (Jan 1, 1970).
PurchaseTime int64 `json:"purchaseTime,omitempty,string"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ConsumptionState") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *InappPurchase) MarshalJSON() ([]byte, error) {
type noMethod InappPurchase
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// SubscriptionPurchase: A SubscriptionPurchase resource indicates the
// status of a user's subscription purchase.
type SubscriptionPurchase struct {
// AutoRenewing: Whether the subscription will automatically be renewed
// when it reaches its current expiry time.
AutoRenewing bool `json:"autoRenewing,omitempty"`
// InitiationTimestampMsec: Time at which the subscription was granted,
// in milliseconds since Epoch.
InitiationTimestampMsec int64 `json:"initiationTimestampMsec,omitempty,string"`
// Kind: This kind represents a subscriptionPurchase object in the
// androidpublisher service.
Kind string `json:"kind,omitempty"`
// ValidUntilTimestampMsec: Time at which the subscription will expire,
// in milliseconds since Epoch.
ValidUntilTimestampMsec int64 `json:"validUntilTimestampMsec,omitempty,string"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AutoRenewing") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) {
type noMethod SubscriptionPurchase
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "androidpublisher.inapppurchases.get":
type InapppurchasesGetCall struct {
s *Service
packageName string
productId string
token string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Checks the purchase and consumption status of an inapp item.
func (r *InapppurchasesService) Get(packageName string, productId string, token string) *InapppurchasesGetCall {
c := &InapppurchasesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.packageName = packageName
c.productId = productId
c.token = token
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *InapppurchasesGetCall) Fields(s ...googleapi.Field) *InapppurchasesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *InapppurchasesGetCall) IfNoneMatch(entityTag string) *InapppurchasesGetCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *InapppurchasesGetCall) Context(ctx context.Context) *InapppurchasesGetCall {
c.ctx_ = ctx
return c
}
func (c *InapppurchasesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "{packageName}/inapp/{productId}/purchases/{token}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"packageName": c.packageName,
"productId": c.productId,
"token": c.token,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidpublisher.inapppurchases.get" call.
// Exactly one of *InappPurchase or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *InappPurchase.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 *InapppurchasesGetCall) Do() (*InappPurchase, 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 := &InappPurchase{
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": "Checks the purchase and consumption status of an inapp item.",
// "httpMethod": "GET",
// "id": "androidpublisher.inapppurchases.get",
// "parameterOrder": [
// "packageName",
// "productId",
// "token"
// ],
// "parameters": {
// "packageName": {
// "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "productId": {
// "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "token": {
// "description": "The token provided to the user's device when the inapp product was purchased.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{packageName}/inapp/{productId}/purchases/{token}",
// "response": {
// "$ref": "InappPurchase"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidpublisher"
// ]
// }
}
// method id "androidpublisher.purchases.cancel":
type PurchasesCancelCall struct {
s *Service
packageName string
subscriptionId string
token string
opt_ map[string]interface{}
ctx_ context.Context
}
// Cancel: Cancels a user's subscription purchase. The subscription
// remains valid until its expiration time.
func (r *PurchasesService) Cancel(packageName string, subscriptionId string, token string) *PurchasesCancelCall {
c := &PurchasesCancelCall{s: r.s, opt_: make(map[string]interface{})}
c.packageName = packageName
c.subscriptionId = subscriptionId
c.token = token
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *PurchasesCancelCall) Fields(s ...googleapi.Field) *PurchasesCancelCall {
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.
func (c *PurchasesCancelCall) Context(ctx context.Context) *PurchasesCancelCall {
c.ctx_ = ctx
return c
}
func (c *PurchasesCancelCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"packageName": c.packageName,
"subscriptionId": c.subscriptionId,
"token": c.token,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidpublisher.purchases.cancel" call.
func (c *PurchasesCancelCall) 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": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
// "httpMethod": "POST",
// "id": "androidpublisher.purchases.cancel",
// "parameterOrder": [
// "packageName",
// "subscriptionId",
// "token"
// ],
// "parameters": {
// "packageName": {
// "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "subscriptionId": {
// "description": "The purchased subscription ID (for example, 'monthly001').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "token": {
// "description": "The token provided to the user's device when the subscription was purchased.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel",
// "scopes": [
// "https://www.googleapis.com/auth/androidpublisher"
// ]
// }
}
// method id "androidpublisher.purchases.get":
type PurchasesGetCall struct {
s *Service
packageName string
subscriptionId string
token string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Checks whether a user's subscription purchase is valid and
// returns its expiry time.
func (r *PurchasesService) Get(packageName string, subscriptionId string, token string) *PurchasesGetCall {
c := &PurchasesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.packageName = packageName
c.subscriptionId = subscriptionId
c.token = token
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *PurchasesGetCall) Fields(s ...googleapi.Field) *PurchasesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *PurchasesGetCall) IfNoneMatch(entityTag string) *PurchasesGetCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *PurchasesGetCall) Context(ctx context.Context) *PurchasesGetCall {
c.ctx_ = ctx
return c
}
func (c *PurchasesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"packageName": c.packageName,
"subscriptionId": c.subscriptionId,
"token": c.token,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidpublisher.purchases.get" call.
// Exactly one of *SubscriptionPurchase or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SubscriptionPurchase.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 *PurchasesGetCall) Do() (*SubscriptionPurchase, 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 := &SubscriptionPurchase{
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": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
// "httpMethod": "GET",
// "id": "androidpublisher.purchases.get",
// "parameterOrder": [
// "packageName",
// "subscriptionId",
// "token"
// ],
// "parameters": {
// "packageName": {
// "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "subscriptionId": {
// "description": "The purchased subscription ID (for example, 'monthly001').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "token": {
// "description": "The token provided to the user's device when the subscription was purchased.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}",
// "response": {
// "$ref": "SubscriptionPurchase"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidpublisher"
// ]
// }
}

View file

@ -1,184 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/JGynskXPDYAm7HfLDYPma5VcVjE\"",
"discoveryVersion": "v1",
"id": "androidpublisher:v1",
"name": "androidpublisher",
"canonicalName": "Android Publisher",
"version": "v1",
"revision": "20150323",
"title": "Google Play Developer API",
"description": "Lets Android application developers access their Google Play accounts.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/android-16.png",
"x32": "https://www.google.com/images/icons/product/android-32.png"
},
"documentationLink": "https://developers.google.com/android-publisher",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/androidpublisher/v1/applications/",
"basePath": "/androidpublisher/v1/applications/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "androidpublisher/v1/applications/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/androidpublisher": {
"description": "View and manage your Google Play Developer account"
}
}
}
},
"schemas": {
"SubscriptionPurchase": {
"id": "SubscriptionPurchase",
"type": "object",
"description": "A SubscriptionPurchase resource indicates the status of a user's subscription purchase.",
"properties": {
"autoRenewing": {
"type": "boolean",
"description": "Whether the subscription will automatically be renewed when it reaches its current expiry time."
},
"initiationTimestampMsec": {
"type": "string",
"description": "Time at which the subscription was granted, in milliseconds since Epoch.",
"format": "int64"
},
"kind": {
"type": "string",
"description": "This kind represents a subscriptionPurchase object in the androidpublisher service.",
"default": "androidpublisher#subscriptionPurchase"
},
"validUntilTimestampMsec": {
"type": "string",
"description": "Time at which the subscription will expire, in milliseconds since Epoch.",
"format": "int64"
}
}
}
},
"resources": {
"purchases": {
"methods": {
"cancel": {
"id": "androidpublisher.purchases.cancel",
"path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel",
"httpMethod": "POST",
"description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
"parameters": {
"packageName": {
"type": "string",
"description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
"required": true,
"location": "path"
},
"subscriptionId": {
"type": "string",
"description": "The purchased subscription ID (for example, 'monthly001').",
"required": true,
"location": "path"
},
"token": {
"type": "string",
"description": "The token provided to the user's device when the subscription was purchased.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"packageName",
"subscriptionId",
"token"
],
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
},
"get": {
"id": "androidpublisher.purchases.get",
"path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}",
"httpMethod": "GET",
"description": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
"parameters": {
"packageName": {
"type": "string",
"description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
"required": true,
"location": "path"
},
"subscriptionId": {
"type": "string",
"description": "The purchased subscription ID (for example, 'monthly001').",
"required": true,
"location": "path"
},
"token": {
"type": "string",
"description": "The token provided to the user's device when the subscription was purchased.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"packageName",
"subscriptionId",
"token"
],
"response": {
"$ref": "SubscriptionPurchase"
},
"scopes": [
"https://www.googleapis.com/auth/androidpublisher"
]
}
}
}
}
}

View file

@ -1,377 +0,0 @@
// Package androidpublisher provides access to the Google Play Developer API.
//
// See https://developers.google.com/android-publisher
//
// Usage example:
//
// import "google.golang.org/api/androidpublisher/v1"
// ...
// androidpublisherService, err := androidpublisher.New(oauthHttpClient)
package androidpublisher // import "google.golang.org/api/androidpublisher/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "androidpublisher:v1"
const apiName = "androidpublisher"
const apiVersion = "v1"
const basePath = "https://www.googleapis.com/androidpublisher/v1/applications/"
// OAuth2 scopes used by this API.
const (
// View and manage your Google Play Developer account
AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Purchases = NewPurchasesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Purchases *PurchasesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewPurchasesService(s *Service) *PurchasesService {
rs := &PurchasesService{s: s}
return rs
}
type PurchasesService struct {
s *Service
}
// SubscriptionPurchase: A SubscriptionPurchase resource indicates the
// status of a user's subscription purchase.
type SubscriptionPurchase struct {
// AutoRenewing: Whether the subscription will automatically be renewed
// when it reaches its current expiry time.
AutoRenewing bool `json:"autoRenewing,omitempty"`
// InitiationTimestampMsec: Time at which the subscription was granted,
// in milliseconds since Epoch.
InitiationTimestampMsec int64 `json:"initiationTimestampMsec,omitempty,string"`
// Kind: This kind represents a subscriptionPurchase object in the
// androidpublisher service.
Kind string `json:"kind,omitempty"`
// ValidUntilTimestampMsec: Time at which the subscription will expire,
// in milliseconds since Epoch.
ValidUntilTimestampMsec int64 `json:"validUntilTimestampMsec,omitempty,string"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AutoRenewing") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) {
type noMethod SubscriptionPurchase
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "androidpublisher.purchases.cancel":
type PurchasesCancelCall struct {
s *Service
packageName string
subscriptionId string
token string
opt_ map[string]interface{}
ctx_ context.Context
}
// Cancel: Cancels a user's subscription purchase. The subscription
// remains valid until its expiration time.
func (r *PurchasesService) Cancel(packageName string, subscriptionId string, token string) *PurchasesCancelCall {
c := &PurchasesCancelCall{s: r.s, opt_: make(map[string]interface{})}
c.packageName = packageName
c.subscriptionId = subscriptionId
c.token = token
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *PurchasesCancelCall) Fields(s ...googleapi.Field) *PurchasesCancelCall {
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.
func (c *PurchasesCancelCall) Context(ctx context.Context) *PurchasesCancelCall {
c.ctx_ = ctx
return c
}
func (c *PurchasesCancelCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"packageName": c.packageName,
"subscriptionId": c.subscriptionId,
"token": c.token,
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidpublisher.purchases.cancel" call.
func (c *PurchasesCancelCall) 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": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
// "httpMethod": "POST",
// "id": "androidpublisher.purchases.cancel",
// "parameterOrder": [
// "packageName",
// "subscriptionId",
// "token"
// ],
// "parameters": {
// "packageName": {
// "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "subscriptionId": {
// "description": "The purchased subscription ID (for example, 'monthly001').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "token": {
// "description": "The token provided to the user's device when the subscription was purchased.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel",
// "scopes": [
// "https://www.googleapis.com/auth/androidpublisher"
// ]
// }
}
// method id "androidpublisher.purchases.get":
type PurchasesGetCall struct {
s *Service
packageName string
subscriptionId string
token string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Checks whether a user's subscription purchase is valid and
// returns its expiry time.
func (r *PurchasesService) Get(packageName string, subscriptionId string, token string) *PurchasesGetCall {
c := &PurchasesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.packageName = packageName
c.subscriptionId = subscriptionId
c.token = token
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *PurchasesGetCall) Fields(s ...googleapi.Field) *PurchasesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *PurchasesGetCall) IfNoneMatch(entityTag string) *PurchasesGetCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *PurchasesGetCall) Context(ctx context.Context) *PurchasesGetCall {
c.ctx_ = ctx
return c
}
func (c *PurchasesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "{packageName}/subscriptions/{subscriptionId}/purchases/{token}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"packageName": c.packageName,
"subscriptionId": c.subscriptionId,
"token": c.token,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "androidpublisher.purchases.get" call.
// Exactly one of *SubscriptionPurchase or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *SubscriptionPurchase.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 *PurchasesGetCall) Do() (*SubscriptionPurchase, 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 := &SubscriptionPurchase{
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": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
// "httpMethod": "GET",
// "id": "androidpublisher.purchases.get",
// "parameterOrder": [
// "packageName",
// "subscriptionId",
// "token"
// ],
// "parameters": {
// "packageName": {
// "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "subscriptionId": {
// "description": "The purchased subscription ID (for example, 'monthly001').",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "token": {
// "description": "The token provided to the user's device when the subscription was purchased.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{packageName}/subscriptions/{subscriptionId}/purchases/{token}",
// "response": {
// "$ref": "SubscriptionPurchase"
// },
// "scopes": [
// "https://www.googleapis.com/auth/androidpublisher"
// ]
// }
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,477 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/ZeC-oWzDKj1E5_H69LVDW5wAByE\"",
"discoveryVersion": "v1",
"id": "appsactivity:v1",
"name": "appsactivity",
"version": "v1",
"revision": "20150326",
"title": "Google Apps Activity API",
"description": "Provides a historical view of activity.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://developers.google.com/google-apps/activity/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/appsactivity/v1/",
"basePath": "/appsactivity/v1/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "appsactivity/v1/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/activity": {
"description": "View the activity history of your Google Apps"
},
"https://www.googleapis.com/auth/drive": {
"description": "View and manage the files in your Google Drive"
},
"https://www.googleapis.com/auth/drive.metadata": {
"description": "View and manage metadata of files in your Google Drive"
},
"https://www.googleapis.com/auth/drive.metadata.readonly": {
"description": "View metadata for files in your Google Drive"
},
"https://www.googleapis.com/auth/drive.readonly": {
"description": "View the files in your Google Drive"
}
}
}
},
"schemas": {
"Activity": {
"id": "Activity",
"type": "object",
"description": "An Activity resource is a combined view of multiple events. An activity has a list of individual events and a combined view of the common fields among all events.",
"properties": {
"combinedEvent": {
"$ref": "Event",
"description": "The fields common to all of the singleEvents that make up the Activity."
},
"singleEvents": {
"type": "array",
"description": "A list of all the Events that make up the Activity.",
"items": {
"$ref": "Event"
}
}
}
},
"Event": {
"id": "Event",
"type": "object",
"description": "Represents the changes associated with an action taken by a user.",
"properties": {
"additionalEventTypes": {
"type": "array",
"description": "Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document, renaming it, and sharing it may be part of a single file-creation event.",
"items": {
"type": "string",
"enum": [
"comment",
"create",
"edit",
"emptyTrash",
"move",
"permissionChange",
"rename",
"trash",
"unknown",
"untrash",
"upload"
],
"enumDescriptions": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
}
},
"eventTimeMillis": {
"type": "string",
"description": "The time at which the event occurred formatted as Unix time in milliseconds.",
"format": "uint64"
},
"fromUserDeletion": {
"type": "boolean",
"description": "Whether this event is caused by a user being deleted."
},
"move": {
"$ref": "Move",
"description": "Extra information for move type events, such as changes in an object's parents."
},
"permissionChanges": {
"type": "array",
"description": "Extra information for permissionChange type events, such as the user or group the new permission applies to.",
"items": {
"$ref": "PermissionChange"
}
},
"primaryEventType": {
"type": "string",
"description": "The main type of event that occurred.",
"enum": [
"comment",
"create",
"edit",
"emptyTrash",
"move",
"permissionChange",
"rename",
"trash",
"unknown",
"untrash",
"upload"
],
"enumDescriptions": [
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
]
},
"rename": {
"$ref": "Rename",
"description": "Extra information for rename type events, such as the old and new names."
},
"target": {
"$ref": "Target",
"description": "Information specific to the Target object modified by the event."
},
"user": {
"$ref": "User",
"description": "Represents the user responsible for the event."
}
}
},
"ListActivitiesResponse": {
"id": "ListActivitiesResponse",
"type": "object",
"description": "The response from the list request. Contains a list of activities and a token to retrieve the next page of results.",
"properties": {
"activities": {
"type": "array",
"description": "List of activities.",
"items": {
"$ref": "Activity"
}
},
"nextPageToken": {
"type": "string",
"description": "Token for the next page of results."
}
}
},
"Move": {
"id": "Move",
"type": "object",
"description": "Contains information about changes in an object's parents as a result of a move type event.",
"properties": {
"addedParents": {
"type": "array",
"description": "The added parent(s).",
"items": {
"$ref": "Parent"
}
},
"removedParents": {
"type": "array",
"description": "The removed parent(s).",
"items": {
"$ref": "Parent"
}
}
}
},
"Parent": {
"id": "Parent",
"type": "object",
"description": "Contains information about a parent object. For example, a folder in Drive is a parent for all files within it.",
"properties": {
"id": {
"type": "string",
"description": "The parent's ID."
},
"isRoot": {
"type": "boolean",
"description": "Whether this is the root folder."
},
"title": {
"type": "string",
"description": "The parent's title."
}
}
},
"Permission": {
"id": "Permission",
"type": "object",
"description": "Contains information about the permissions and type of access allowed with regards to a Google Drive object. This is a subset of the fields contained in a corresponding Drive Permissions object.",
"properties": {
"name": {
"type": "string",
"description": "The name of the user or group the permission applies to."
},
"permissionId": {
"type": "string",
"description": "The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource."
},
"role": {
"type": "string",
"description": "Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file.",
"enum": [
"commenter",
"owner",
"reader",
"writer"
],
"enumDescriptions": [
"",
"",
"",
""
]
},
"type": {
"type": "string",
"description": "Indicates how widely permissions are granted.",
"enum": [
"anyone",
"domain",
"group",
"user"
],
"enumDescriptions": [
"",
"",
"",
""
]
},
"user": {
"$ref": "User",
"description": "The user's information if the type is USER."
},
"withLink": {
"type": "boolean",
"description": "Whether the permission requires a link to the file."
}
}
},
"PermissionChange": {
"id": "PermissionChange",
"type": "object",
"description": "Contains information about a Drive object's permissions that changed as a result of a permissionChange type event.",
"properties": {
"addedPermissions": {
"type": "array",
"description": "Lists all Permission objects added.",
"items": {
"$ref": "Permission"
}
},
"removedPermissions": {
"type": "array",
"description": "Lists all Permission objects removed.",
"items": {
"$ref": "Permission"
}
}
}
},
"Photo": {
"id": "Photo",
"type": "object",
"description": "Photo information for a user.",
"properties": {
"url": {
"type": "string",
"description": "The URL of the photo."
}
}
},
"Rename": {
"id": "Rename",
"type": "object",
"description": "Contains information about a renametype event.",
"properties": {
"newTitle": {
"type": "string",
"description": "The new title."
},
"oldTitle": {
"type": "string",
"description": "The old title."
}
}
},
"Target": {
"id": "Target",
"type": "object",
"description": "Information about the object modified by the event.",
"properties": {
"id": {
"type": "string",
"description": "The ID of the target. For example, in Google Drive, this is the file or folder ID."
},
"mimeType": {
"type": "string",
"description": "The MIME type of the target."
},
"name": {
"type": "string",
"description": "The name of the target. For example, in Google Drive, this is the title of the file."
}
}
},
"User": {
"id": "User",
"type": "object",
"description": "A representation of a user.",
"properties": {
"name": {
"type": "string",
"description": "The displayable name of the user."
},
"photo": {
"$ref": "Photo",
"description": "The profile photo of the user."
}
}
}
},
"resources": {
"activities": {
"methods": {
"list": {
"id": "appsactivity.activities.list",
"path": "activities",
"httpMethod": "GET",
"description": "Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.",
"parameters": {
"drive.ancestorId": {
"type": "string",
"description": "Identifies the Drive folder containing the items for which to return activities.",
"location": "query"
},
"drive.fileId": {
"type": "string",
"description": "Identifies the Drive item to return activities for.",
"location": "query"
},
"groupingStrategy": {
"type": "string",
"description": "Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object.",
"default": "driveUi",
"enum": [
"driveUi",
"none"
],
"enumDescriptions": [
"",
""
],
"location": "query"
},
"pageSize": {
"type": "integer",
"description": "The maximum number of events to return on a page. The response includes a continuation token if there are more events.",
"default": "50",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A token to retrieve a specific page of results.",
"location": "query"
},
"source": {
"type": "string",
"description": "The Google service from which to return activities. Possible values of source are: \n- drive.google.com",
"location": "query"
},
"userId": {
"type": "string",
"description": "Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user.",
"default": "me",
"location": "query"
}
},
"response": {
"$ref": "ListActivitiesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/activity",
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.metadata",
"https://www.googleapis.com/auth/drive.metadata.readonly",
"https://www.googleapis.com/auth/drive.readonly"
]
}
}
}
}
}

View file

@ -1,704 +0,0 @@
// Package appsactivity provides access to the Google Apps Activity API.
//
// See https://developers.google.com/google-apps/activity/
//
// Usage example:
//
// import "google.golang.org/api/appsactivity/v1"
// ...
// appsactivityService, err := appsactivity.New(oauthHttpClient)
package appsactivity // import "google.golang.org/api/appsactivity/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "appsactivity:v1"
const apiName = "appsactivity"
const apiVersion = "v1"
const basePath = "https://www.googleapis.com/appsactivity/v1/"
// OAuth2 scopes used by this API.
const (
// View the activity history of your Google Apps
ActivityScope = "https://www.googleapis.com/auth/activity"
// View and manage the files in your Google Drive
DriveScope = "https://www.googleapis.com/auth/drive"
// View and manage metadata of files in your Google Drive
DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata"
// View metadata for files in your Google Drive
DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly"
// View the files in your Google Drive
DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Activities = NewActivitiesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Activities *ActivitiesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewActivitiesService(s *Service) *ActivitiesService {
rs := &ActivitiesService{s: s}
return rs
}
type ActivitiesService struct {
s *Service
}
// Activity: An Activity resource is a combined view of multiple events.
// An activity has a list of individual events and a combined view of
// the common fields among all events.
type Activity struct {
// CombinedEvent: The fields common to all of the singleEvents that make
// up the Activity.
CombinedEvent *Event `json:"combinedEvent,omitempty"`
// SingleEvents: A list of all the Events that make up the Activity.
SingleEvents []*Event `json:"singleEvents,omitempty"`
// ForceSendFields is a list of field names (e.g. "CombinedEvent") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Activity) MarshalJSON() ([]byte, error) {
type noMethod Activity
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Event: Represents the changes associated with an action taken by a
// user.
type Event struct {
// AdditionalEventTypes: Additional event types. Some events may have
// multiple types when multiple actions are part of a single event. For
// example, creating a document, renaming it, and sharing it may be part
// of a single file-creation event.
//
// Possible values:
// "comment"
// "create"
// "edit"
// "emptyTrash"
// "move"
// "permissionChange"
// "rename"
// "trash"
// "unknown"
// "untrash"
// "upload"
AdditionalEventTypes []string `json:"additionalEventTypes,omitempty"`
// EventTimeMillis: The time at which the event occurred formatted as
// Unix time in milliseconds.
EventTimeMillis uint64 `json:"eventTimeMillis,omitempty,string"`
// FromUserDeletion: Whether this event is caused by a user being
// deleted.
FromUserDeletion bool `json:"fromUserDeletion,omitempty"`
// Move: Extra information for move type events, such as changes in an
// object's parents.
Move *Move `json:"move,omitempty"`
// PermissionChanges: Extra information for permissionChange type
// events, such as the user or group the new permission applies to.
PermissionChanges []*PermissionChange `json:"permissionChanges,omitempty"`
// PrimaryEventType: The main type of event that occurred.
//
// Possible values:
// "comment"
// "create"
// "edit"
// "emptyTrash"
// "move"
// "permissionChange"
// "rename"
// "trash"
// "unknown"
// "untrash"
// "upload"
PrimaryEventType string `json:"primaryEventType,omitempty"`
// Rename: Extra information for rename type events, such as the old and
// new names.
Rename *Rename `json:"rename,omitempty"`
// Target: Information specific to the Target object modified by the
// event.
Target *Target `json:"target,omitempty"`
// User: Represents the user responsible for the event.
User *User `json:"user,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AdditionalEventTypes") to unconditionally include in API requests.
// By default, fields with empty values are omitted from API requests.
// However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Event) MarshalJSON() ([]byte, error) {
type noMethod Event
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ListActivitiesResponse: The response from the list request. Contains
// a list of activities and a token to retrieve the next page of
// results.
type ListActivitiesResponse struct {
// Activities: List of activities.
Activities []*Activity `json:"activities,omitempty"`
// NextPageToken: Token for the next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Activities") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ListActivitiesResponse) MarshalJSON() ([]byte, error) {
type noMethod ListActivitiesResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Move: Contains information about changes in an object's parents as a
// result of a move type event.
type Move struct {
// AddedParents: The added parent(s).
AddedParents []*Parent `json:"addedParents,omitempty"`
// RemovedParents: The removed parent(s).
RemovedParents []*Parent `json:"removedParents,omitempty"`
// ForceSendFields is a list of field names (e.g. "AddedParents") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Move) MarshalJSON() ([]byte, error) {
type noMethod Move
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Parent: Contains information about a parent object. For example, a
// folder in Drive is a parent for all files within it.
type Parent struct {
// Id: The parent's ID.
Id string `json:"id,omitempty"`
// IsRoot: Whether this is the root folder.
IsRoot bool `json:"isRoot,omitempty"`
// Title: The parent's title.
Title string `json:"title,omitempty"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Parent) MarshalJSON() ([]byte, error) {
type noMethod Parent
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Permission: Contains information about the permissions and type of
// access allowed with regards to a Google Drive object. This is a
// subset of the fields contained in a corresponding Drive Permissions
// object.
type Permission struct {
// Name: The name of the user or group the permission applies to.
Name string `json:"name,omitempty"`
// PermissionId: The ID for this permission. Corresponds to the Drive
// API's permission ID returned as part of the Drive Permissions
// resource.
PermissionId string `json:"permissionId,omitempty"`
// Role: Indicates the Google Drive permissions role. The role
// determines a user's ability to read, write, or comment on the file.
//
// Possible values:
// "commenter"
// "owner"
// "reader"
// "writer"
Role string `json:"role,omitempty"`
// Type: Indicates how widely permissions are granted.
//
// Possible values:
// "anyone"
// "domain"
// "group"
// "user"
Type string `json:"type,omitempty"`
// User: The user's information if the type is USER.
User *User `json:"user,omitempty"`
// WithLink: Whether the permission requires a link to the file.
WithLink bool `json:"withLink,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Permission) MarshalJSON() ([]byte, error) {
type noMethod Permission
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// PermissionChange: Contains information about a Drive object's
// permissions that changed as a result of a permissionChange type
// event.
type PermissionChange struct {
// AddedPermissions: Lists all Permission objects added.
AddedPermissions []*Permission `json:"addedPermissions,omitempty"`
// RemovedPermissions: Lists all Permission objects removed.
RemovedPermissions []*Permission `json:"removedPermissions,omitempty"`
// ForceSendFields is a list of field names (e.g. "AddedPermissions") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *PermissionChange) MarshalJSON() ([]byte, error) {
type noMethod PermissionChange
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Photo: Photo information for a user.
type Photo struct {
// Url: The URL of the photo.
Url string `json:"url,omitempty"`
// ForceSendFields is a list of field names (e.g. "Url") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Photo) MarshalJSON() ([]byte, error) {
type noMethod Photo
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Rename: Contains information about a renametype event.
type Rename struct {
// NewTitle: The new title.
NewTitle string `json:"newTitle,omitempty"`
// OldTitle: The old title.
OldTitle string `json:"oldTitle,omitempty"`
// ForceSendFields is a list of field names (e.g. "NewTitle") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Rename) MarshalJSON() ([]byte, error) {
type noMethod Rename
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Target: Information about the object modified by the event.
type Target struct {
// Id: The ID of the target. For example, in Google Drive, this is the
// file or folder ID.
Id string `json:"id,omitempty"`
// MimeType: The MIME type of the target.
MimeType string `json:"mimeType,omitempty"`
// Name: The name of the target. For example, in Google Drive, this is
// the title of the file.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Id") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Target) MarshalJSON() ([]byte, error) {
type noMethod Target
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// User: A representation of a user.
type User struct {
// Name: The displayable name of the user.
Name string `json:"name,omitempty"`
// Photo: The profile photo of the user.
Photo *Photo `json:"photo,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *User) MarshalJSON() ([]byte, error) {
type noMethod User
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "appsactivity.activities.list":
type ActivitiesListCall struct {
s *Service
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Returns a list of activities visible to the current logged in
// user. Visible activities are determined by the visiblity settings of
// the object that was acted on, e.g. Drive files a user can see. An
// activity is a record of past events. Multiple events may be merged if
// they are similar. A request is scoped to activities from a given
// Google service using the source parameter.
func (r *ActivitiesService) List() *ActivitiesListCall {
c := &ActivitiesListCall{s: r.s, opt_: make(map[string]interface{})}
return c
}
// DriveAncestorId sets the optional parameter "drive.ancestorId":
// Identifies the Drive folder containing the items for which to return
// activities.
func (c *ActivitiesListCall) DriveAncestorId(driveAncestorId string) *ActivitiesListCall {
c.opt_["drive.ancestorId"] = driveAncestorId
return c
}
// DriveFileId sets the optional parameter "drive.fileId": Identifies
// the Drive item to return activities for.
func (c *ActivitiesListCall) DriveFileId(driveFileId string) *ActivitiesListCall {
c.opt_["drive.fileId"] = driveFileId
return c
}
// GroupingStrategy sets the optional parameter "groupingStrategy":
// Indicates the strategy to use when grouping singleEvents items in the
// associated combinedEvent object.
//
// Possible values:
// "driveUi" (default)
// "none"
func (c *ActivitiesListCall) GroupingStrategy(groupingStrategy string) *ActivitiesListCall {
c.opt_["groupingStrategy"] = groupingStrategy
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number
// of events to return on a page. The response includes a continuation
// token if there are more events.
func (c *ActivitiesListCall) PageSize(pageSize int64) *ActivitiesListCall {
c.opt_["pageSize"] = pageSize
return c
}
// PageToken sets the optional parameter "pageToken": A token to
// retrieve a specific page of results.
func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall {
c.opt_["pageToken"] = pageToken
return c
}
// Source sets the optional parameter "source": The Google service from
// which to return activities. Possible values of source are:
// - drive.google.com
func (c *ActivitiesListCall) Source(source string) *ActivitiesListCall {
c.opt_["source"] = source
return c
}
// UserId sets the optional parameter "userId": Indicates the user to
// return activity for. Use the special value me to indicate the
// currently authenticated user.
func (c *ActivitiesListCall) UserId(userId string) *ActivitiesListCall {
c.opt_["userId"] = userId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {
c.ctx_ = ctx
return c
}
func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["drive.ancestorId"]; ok {
params.Set("drive.ancestorId", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["drive.fileId"]; ok {
params.Set("drive.fileId", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["groupingStrategy"]; ok {
params.Set("groupingStrategy", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageSize"]; ok {
params.Set("pageSize", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["source"]; ok {
params.Set("source", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["userId"]; ok {
params.Set("userId", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "appsactivity.activities.list" call.
// Exactly one of *ListActivitiesResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListActivitiesResponse.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 *ActivitiesListCall) Do() (*ListActivitiesResponse, 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 := &ListActivitiesResponse{
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": "Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.",
// "httpMethod": "GET",
// "id": "appsactivity.activities.list",
// "parameters": {
// "drive.ancestorId": {
// "description": "Identifies the Drive folder containing the items for which to return activities.",
// "location": "query",
// "type": "string"
// },
// "drive.fileId": {
// "description": "Identifies the Drive item to return activities for.",
// "location": "query",
// "type": "string"
// },
// "groupingStrategy": {
// "default": "driveUi",
// "description": "Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object.",
// "enum": [
// "driveUi",
// "none"
// ],
// "enumDescriptions": [
// "",
// ""
// ],
// "location": "query",
// "type": "string"
// },
// "pageSize": {
// "default": "50",
// "description": "The maximum number of events to return on a page. The response includes a continuation token if there are more events.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A token to retrieve a specific page of results.",
// "location": "query",
// "type": "string"
// },
// "source": {
// "description": "The Google service from which to return activities. Possible values of source are: \n- drive.google.com",
// "location": "query",
// "type": "string"
// },
// "userId": {
// "default": "me",
// "description": "Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "activities",
// "response": {
// "$ref": "ListActivitiesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/activity",
// "https://www.googleapis.com/auth/drive",
// "https://www.googleapis.com/auth/drive.metadata",
// "https://www.googleapis.com/auth/drive.metadata.readonly",
// "https://www.googleapis.com/auth/drive.readonly"
// ]
// }
}

View file

@ -1,307 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/fq2tcHmUUpw0BqgyQT2jiNE1XgU\"",
"discoveryVersion": "v1",
"id": "appstate:v1",
"name": "appstate",
"canonicalName": "App State",
"version": "v1",
"revision": "20150119",
"title": "Google App State API",
"description": "The Google App State API.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://developers.google.com/games/services/web/api/states",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/appstate/v1/",
"basePath": "/appstate/v1/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "appstate/v1/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/appstate": {
"description": "View and manage your data for this application"
}
}
}
},
"schemas": {
"GetResponse": {
"id": "GetResponse",
"type": "object",
"description": "This is a JSON template for an app state resource.",
"properties": {
"currentStateVersion": {
"type": "string",
"description": "The current app state version."
},
"data": {
"type": "string",
"description": "The requested data."
},
"kind": {
"type": "string",
"description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse.",
"default": "appstate#getResponse"
},
"stateKey": {
"type": "integer",
"description": "The key for the data.",
"format": "int32"
}
}
},
"ListResponse": {
"id": "ListResponse",
"type": "object",
"description": "This is a JSON template to convert a list-response for app state.",
"properties": {
"items": {
"type": "array",
"description": "The app state data.",
"items": {
"$ref": "GetResponse"
}
},
"kind": {
"type": "string",
"description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse.",
"default": "appstate#listResponse"
},
"maximumKeyCount": {
"type": "integer",
"description": "The maximum number of keys allowed for this user.",
"format": "int32"
}
}
},
"UpdateRequest": {
"id": "UpdateRequest",
"type": "object",
"description": "This is a JSON template for a requests which update app state",
"properties": {
"data": {
"type": "string",
"description": "The new app state data that your application is trying to update with."
},
"kind": {
"type": "string",
"description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest.",
"default": "appstate#updateRequest"
}
}
},
"WriteResult": {
"id": "WriteResult",
"type": "object",
"description": "This is a JSON template for an app state write result.",
"properties": {
"currentStateVersion": {
"type": "string",
"description": "The version of the data for this key on the server."
},
"kind": {
"type": "string",
"description": "Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult.",
"default": "appstate#writeResult"
},
"stateKey": {
"type": "integer",
"description": "The written key.",
"format": "int32"
}
}
}
},
"resources": {
"states": {
"methods": {
"clear": {
"id": "appstate.states.clear",
"path": "states/{stateKey}/clear",
"httpMethod": "POST",
"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.",
"parameters": {
"currentDataVersion": {
"type": "string",
"description": "The version of the data to be cleared. Version strings are returned by the server.",
"location": "query"
},
"stateKey": {
"type": "integer",
"description": "The key for the data to be retrieved.",
"required": true,
"format": "int32",
"minimum": "0",
"maximum": "3",
"location": "path"
}
},
"parameterOrder": [
"stateKey"
],
"response": {
"$ref": "WriteResult"
},
"scopes": [
"https://www.googleapis.com/auth/appstate"
]
},
"delete": {
"id": "appstate.states.delete",
"path": "states/{stateKey}",
"httpMethod": "DELETE",
"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.",
"parameters": {
"stateKey": {
"type": "integer",
"description": "The key for the data to be retrieved.",
"required": true,
"format": "int32",
"minimum": "0",
"maximum": "3",
"location": "path"
}
},
"parameterOrder": [
"stateKey"
],
"scopes": [
"https://www.googleapis.com/auth/appstate"
]
},
"get": {
"id": "appstate.states.get",
"path": "states/{stateKey}",
"httpMethod": "GET",
"description": "Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.",
"parameters": {
"stateKey": {
"type": "integer",
"description": "The key for the data to be retrieved.",
"required": true,
"format": "int32",
"minimum": "0",
"maximum": "3",
"location": "path"
}
},
"parameterOrder": [
"stateKey"
],
"response": {
"$ref": "GetResponse"
},
"scopes": [
"https://www.googleapis.com/auth/appstate"
]
},
"list": {
"id": "appstate.states.list",
"path": "states",
"httpMethod": "GET",
"description": "Lists all the states keys, and optionally the state data.",
"parameters": {
"includeData": {
"type": "boolean",
"description": "Whether to include the full data in addition to the version number",
"default": "false",
"location": "query"
}
},
"response": {
"$ref": "ListResponse"
},
"scopes": [
"https://www.googleapis.com/auth/appstate"
]
},
"update": {
"id": "appstate.states.update",
"path": "states/{stateKey}",
"httpMethod": "PUT",
"description": "Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.",
"parameters": {
"currentStateVersion": {
"type": "string",
"description": "The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter.",
"location": "query"
},
"stateKey": {
"type": "integer",
"description": "The key for the data to be retrieved.",
"required": true,
"format": "int32",
"minimum": "0",
"maximum": "3",
"location": "path"
}
},
"parameterOrder": [
"stateKey"
],
"request": {
"$ref": "UpdateRequest"
},
"response": {
"$ref": "WriteResult"
},
"scopes": [
"https://www.googleapis.com/auth/appstate"
]
}
}
}
}
}

View file

@ -1,845 +0,0 @@
// Package appstate provides access to the Google App State API.
//
// See https://developers.google.com/games/services/web/api/states
//
// Usage example:
//
// import "google.golang.org/api/appstate/v1"
// ...
// appstateService, err := appstate.New(oauthHttpClient)
package appstate // import "google.golang.org/api/appstate/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "appstate:v1"
const apiName = "appstate"
const apiVersion = "v1"
const basePath = "https://www.googleapis.com/appstate/v1/"
// OAuth2 scopes used by this API.
const (
// View and manage your data for this application
AppstateScope = "https://www.googleapis.com/auth/appstate"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.States = NewStatesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
States *StatesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewStatesService(s *Service) *StatesService {
rs := &StatesService{s: s}
return rs
}
type StatesService struct {
s *Service
}
// GetResponse: This is a JSON template for an app state resource.
type GetResponse struct {
// CurrentStateVersion: The current app state version.
CurrentStateVersion string `json:"currentStateVersion,omitempty"`
// Data: The requested data.
Data string `json:"data,omitempty"`
// Kind: Uniquely identifies the type of this resource. Value is always
// the fixed string appstate#getResponse.
Kind string `json:"kind,omitempty"`
// StateKey: The key for the data.
StateKey int64 `json:"stateKey,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CurrentStateVersion")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *GetResponse) MarshalJSON() ([]byte, error) {
type noMethod GetResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ListResponse: This is a JSON template to convert a list-response for
// app state.
type ListResponse struct {
// Items: The app state data.
Items []*GetResponse `json:"items,omitempty"`
// Kind: Uniquely identifies the type of this resource. Value is always
// the fixed string appstate#listResponse.
Kind string `json:"kind,omitempty"`
// MaximumKeyCount: The maximum number of keys allowed for this user.
MaximumKeyCount int64 `json:"maximumKeyCount,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ListResponse) MarshalJSON() ([]byte, error) {
type noMethod ListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// UpdateRequest: This is a JSON template for a requests which update
// app state
type UpdateRequest struct {
// Data: The new app state data that your application is trying to
// update with.
Data string `json:"data,omitempty"`
// Kind: Uniquely identifies the type of this resource. Value is always
// the fixed string appstate#updateRequest.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "Data") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *UpdateRequest) MarshalJSON() ([]byte, error) {
type noMethod UpdateRequest
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// WriteResult: This is a JSON template for an app state write result.
type WriteResult struct {
// CurrentStateVersion: The version of the data for this key on the
// server.
CurrentStateVersion string `json:"currentStateVersion,omitempty"`
// Kind: Uniquely identifies the type of this resource. Value is always
// the fixed string appstate#writeResult.
Kind string `json:"kind,omitempty"`
// StateKey: The written key.
StateKey int64 `json:"stateKey,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CurrentStateVersion")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *WriteResult) MarshalJSON() ([]byte, error) {
type noMethod WriteResult
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "appstate.states.clear":
type StatesClearCall struct {
s *Service
stateKey int64
opt_ map[string]interface{}
ctx_ context.Context
}
// Clear: 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.
func (r *StatesService) Clear(stateKey int64) *StatesClearCall {
c := &StatesClearCall{s: r.s, opt_: make(map[string]interface{})}
c.stateKey = stateKey
return c
}
// CurrentDataVersion sets the optional parameter "currentDataVersion":
// The version of the data to be cleared. Version strings are returned
// by the server.
func (c *StatesClearCall) CurrentDataVersion(currentDataVersion string) *StatesClearCall {
c.opt_["currentDataVersion"] = currentDataVersion
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatesClearCall) Fields(s ...googleapi.Field) *StatesClearCall {
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.
func (c *StatesClearCall) Context(ctx context.Context) *StatesClearCall {
c.ctx_ = ctx
return c
}
func (c *StatesClearCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["currentDataVersion"]; ok {
params.Set("currentDataVersion", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}/clear")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"stateKey": strconv.FormatInt(c.stateKey, 10),
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "appstate.states.clear" call.
// Exactly one of *WriteResult or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *WriteResult.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 *StatesClearCall) Do() (*WriteResult, 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 := &WriteResult{
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": "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"
// ]
// }
}
// method id "appstate.states.delete":
type StatesDeleteCall struct {
s *Service
stateKey int64
opt_ map[string]interface{}
ctx_ context.Context
}
// Delete: 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.
func (r *StatesService) Delete(stateKey int64) *StatesDeleteCall {
c := &StatesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.stateKey = stateKey
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatesDeleteCall) Fields(s ...googleapi.Field) *StatesDeleteCall {
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.
func (c *StatesDeleteCall) Context(ctx context.Context) *StatesDeleteCall {
c.ctx_ = ctx
return c
}
func (c *StatesDeleteCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "states/{stateKey}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"stateKey": strconv.FormatInt(c.stateKey, 10),
})
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// 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"
// ]
// }
}
// method id "appstate.states.get":
type StatesGetCall struct {
s *Service
stateKey int64
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Retrieves the data corresponding to the passed key. If the key
// does not exist on the server, an HTTP 404 will be returned.
func (r *StatesService) Get(stateKey int64) *StatesGetCall {
c := &StatesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.stateKey = stateKey
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatesGetCall) Fields(s ...googleapi.Field) *StatesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *StatesGetCall) IfNoneMatch(entityTag string) *StatesGetCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *StatesGetCall) Context(ctx context.Context) *StatesGetCall {
c.ctx_ = ctx
return c
}
func (c *StatesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "states/{stateKey}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"stateKey": strconv.FormatInt(c.stateKey, 10),
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "appstate.states.get" call.
// Exactly one of *GetResponse or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *GetResponse.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 *StatesGetCall) Do() (*GetResponse, 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 := &GetResponse{
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": "Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.",
// "httpMethod": "GET",
// "id": "appstate.states.get",
// "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}",
// "response": {
// "$ref": "GetResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/appstate"
// ]
// }
}
// method id "appstate.states.list":
type StatesListCall struct {
s *Service
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Lists all the states keys, and optionally the state data.
func (r *StatesService) List() *StatesListCall {
c := &StatesListCall{s: r.s, opt_: make(map[string]interface{})}
return c
}
// IncludeData sets the optional parameter "includeData": Whether to
// include the full data in addition to the version number
func (c *StatesListCall) IncludeData(includeData bool) *StatesListCall {
c.opt_["includeData"] = includeData
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatesListCall) Fields(s ...googleapi.Field) *StatesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *StatesListCall) IfNoneMatch(entityTag string) *StatesListCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *StatesListCall) Context(ctx context.Context) *StatesListCall {
c.ctx_ = ctx
return c
}
func (c *StatesListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["includeData"]; ok {
params.Set("includeData", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "states")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "appstate.states.list" call.
// Exactly one of *ListResponse or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *ListResponse.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 *StatesListCall) Do() (*ListResponse, 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 := &ListResponse{
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": "Lists all the states keys, and optionally the state data.",
// "httpMethod": "GET",
// "id": "appstate.states.list",
// "parameters": {
// "includeData": {
// "default": "false",
// "description": "Whether to include the full data in addition to the version number",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "states",
// "response": {
// "$ref": "ListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/appstate"
// ]
// }
}
// method id "appstate.states.update":
type StatesUpdateCall struct {
s *Service
stateKey int64
updaterequest *UpdateRequest
opt_ map[string]interface{}
ctx_ context.Context
}
// Update: Update the data associated with the input key if and only if
// the passed version matches the currently stored version. This method
// is safe in the face of concurrent writes. Maximum per-key size is
// 128KB.
func (r *StatesService) Update(stateKey int64, updaterequest *UpdateRequest) *StatesUpdateCall {
c := &StatesUpdateCall{s: r.s, opt_: make(map[string]interface{})}
c.stateKey = stateKey
c.updaterequest = updaterequest
return c
}
// CurrentStateVersion sets the optional parameter
// "currentStateVersion": The version of the app state your application
// is attempting to update. If this does not match the current version,
// this method will return a conflict error. If there is no data stored
// on the server for this key, the update will succeed irrespective of
// the value of this parameter.
func (c *StatesUpdateCall) CurrentStateVersion(currentStateVersion string) *StatesUpdateCall {
c.opt_["currentStateVersion"] = currentStateVersion
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatesUpdateCall) Fields(s ...googleapi.Field) *StatesUpdateCall {
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.
func (c *StatesUpdateCall) Context(ctx context.Context) *StatesUpdateCall {
c.ctx_ = ctx
return c
}
func (c *StatesUpdateCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.updaterequest)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["currentStateVersion"]; ok {
params.Set("currentStateVersion", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "states/{stateKey}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"stateKey": strconv.FormatInt(c.stateKey, 10),
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "appstate.states.update" call.
// Exactly one of *WriteResult or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *WriteResult.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 *StatesUpdateCall) Do() (*WriteResult, 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 := &WriteResult{
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": "Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.",
// "httpMethod": "PUT",
// "id": "appstate.states.update",
// "parameterOrder": [
// "stateKey"
// ],
// "parameters": {
// "currentStateVersion": {
// "description": "The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter.",
// "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}",
// "request": {
// "$ref": "UpdateRequest"
// },
// "response": {
// "$ref": "WriteResult"
// },
// "scopes": [
// "https://www.googleapis.com/auth/appstate"
// ]
// }
}

View file

@ -1,891 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/UcR-fBYlWEXj2JrwS8u3wjdNZ58\"",
"discoveryVersion": "v1",
"id": "autoscaler:v1beta2",
"name": "autoscaler",
"version": "v1beta2",
"revision": "20150213",
"title": "Google Compute Engine Autoscaler API",
"description": "The Google Compute Engine Autoscaler API provides autoscaling for groups of Cloud VMs.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "http://developers.google.com/compute/docs/autoscaler",
"labels": [
"limited_availability"
],
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/autoscaler/v1beta2/",
"basePath": "/autoscaler/v1beta2/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "autoscaler/v1beta2/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/compute": {
"description": "View and manage your Google Compute Engine resources"
},
"https://www.googleapis.com/auth/compute.readonly": {
"description": "View your Google Compute Engine resources"
}
}
}
},
"schemas": {
"Autoscaler": {
"id": "Autoscaler",
"type": "object",
"description": "Cloud Autoscaler resource.",
"properties": {
"autoscalingPolicy": {
"$ref": "AutoscalingPolicy",
"description": "Configuration parameters for autoscaling algorithm."
},
"creationTimestamp": {
"type": "string",
"description": "[Output Only] Creation timestamp in RFC3339 text format."
},
"description": {
"type": "string",
"description": "An optional textual description of the resource provided by the client."
},
"id": {
"type": "string",
"description": "[Output Only] Unique identifier for the resource; defined by the server.",
"format": "uint64"
},
"kind": {
"type": "string",
"description": "Type of resource.",
"default": "compute#autoscaler"
},
"name": {
"type": "string",
"description": "Name of the Autoscaler resource. Must be unique per project and zone."
},
"selfLink": {
"type": "string",
"description": "[Output Only] A self-link to the Autoscaler configuration resource."
},
"target": {
"type": "string",
"description": "URL to the entity which will be autoscaled. Currently the only supported value is ReplicaPool?s URL. Note: it is illegal to specify multiple Autoscalers for the same target."
}
}
},
"AutoscalerListResponse": {
"id": "AutoscalerListResponse",
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "Autoscaler resources.",
"items": {
"$ref": "Autoscaler"
}
},
"kind": {
"type": "string",
"description": "Type of resource.",
"default": "compute#autoscalerList"
},
"nextPageToken": {
"type": "string",
"description": "[Output only] A token used to continue a truncated list request."
}
}
},
"AutoscalingPolicy": {
"id": "AutoscalingPolicy",
"type": "object",
"description": "Cloud Autoscaler policy.",
"properties": {
"coolDownPeriodSec": {
"type": "integer",
"description": "The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.",
"format": "int32"
},
"cpuUtilization": {
"$ref": "AutoscalingPolicyCpuUtilization",
"description": "Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy."
},
"customMetricUtilizations": {
"type": "array",
"description": "Configuration parameters of autoscaling based on custom metric.",
"items": {
"$ref": "AutoscalingPolicyCustomMetricUtilization"
}
},
"loadBalancingUtilization": {
"$ref": "AutoscalingPolicyLoadBalancingUtilization",
"description": "Configuration parameters of autoscaling based on load balancer."
},
"maxNumReplicas": {
"type": "integer",
"description": "The maximum number of replicas that the Autoscaler can scale up to.",
"format": "int32"
},
"minNumReplicas": {
"type": "integer",
"description": "The minimum number of replicas that the Autoscaler can scale down to.",
"format": "int32"
}
}
},
"AutoscalingPolicyCpuUtilization": {
"id": "AutoscalingPolicyCpuUtilization",
"type": "object",
"description": "CPU utilization policy.",
"properties": {
"utilizationTarget": {
"type": "number",
"description": "The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.",
"format": "double"
}
}
},
"AutoscalingPolicyCustomMetricUtilization": {
"id": "AutoscalingPolicyCustomMetricUtilization",
"type": "object",
"description": "Custom utilization metric policy.",
"properties": {
"metric": {
"type": "string",
"description": "Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count."
},
"utilizationTarget": {
"type": "number",
"description": "Target value of the metric which Autoscaler should maintain. Must be a positive value.",
"format": "double"
},
"utilizationTargetType": {
"type": "string",
"description": "Defines type in which utilization_target is expressed."
}
}
},
"AutoscalingPolicyLoadBalancingUtilization": {
"id": "AutoscalingPolicyLoadBalancingUtilization",
"type": "object",
"description": "Load balancing utilization policy.",
"properties": {
"utilizationTarget": {
"type": "number",
"description": "Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.",
"format": "double"
}
}
},
"DeprecationStatus": {
"id": "DeprecationStatus",
"type": "object",
"properties": {
"deleted": {
"type": "string"
},
"deprecated": {
"type": "string"
},
"obsolete": {
"type": "string"
},
"replacement": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"Operation": {
"id": "Operation",
"type": "object",
"properties": {
"clientOperationId": {
"type": "string"
},
"creationTimestamp": {
"type": "string"
},
"endTime": {
"type": "string"
},
"error": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"location": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
},
"httpErrorMessage": {
"type": "string"
},
"httpErrorStatusCode": {
"type": "integer",
"format": "int32"
},
"id": {
"type": "string",
"format": "uint64"
},
"insertTime": {
"type": "string"
},
"kind": {
"type": "string",
"description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.",
"default": "autoscaler#operation"
},
"name": {
"type": "string"
},
"operationType": {
"type": "string"
},
"progress": {
"type": "integer",
"format": "int32"
},
"region": {
"type": "string"
},
"selfLink": {
"type": "string"
},
"startTime": {
"type": "string"
},
"status": {
"type": "string"
},
"statusMessage": {
"type": "string"
},
"targetId": {
"type": "string",
"format": "uint64"
},
"targetLink": {
"type": "string"
},
"user": {
"type": "string"
},
"warnings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
},
"message": {
"type": "string"
}
}
}
},
"zone": {
"type": "string"
}
}
},
"OperationList": {
"id": "OperationList",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"$ref": "Operation"
}
},
"kind": {
"type": "string",
"description": "[Output Only] Type of resource. Always compute#operations for Operations resource.",
"default": "autoscaler#operationList"
},
"nextPageToken": {
"type": "string"
},
"selfLink": {
"type": "string"
}
}
},
"Zone": {
"id": "Zone",
"type": "object",
"properties": {
"creationTimestamp": {
"type": "string"
},
"deprecated": {
"$ref": "DeprecationStatus"
},
"description": {
"type": "string"
},
"id": {
"type": "string",
"format": "uint64"
},
"kind": {
"type": "string",
"description": "[Output Only] Type of the resource. Always kind#zone for zones.",
"default": "autoscaler#zone"
},
"maintenanceWindows": {
"type": "array",
"items": {
"type": "object",
"properties": {
"beginTime": {
"type": "string"
},
"description": {
"type": "string"
},
"endTime": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
},
"name": {
"type": "string"
},
"region": {
"type": "string"
},
"selfLink": {
"type": "string",
"description": "[Output Only] Server defined URL for the resource."
},
"status": {
"type": "string"
}
}
},
"ZoneList": {
"id": "ZoneList",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"$ref": "Zone"
}
},
"kind": {
"type": "string",
"description": "Type of resource.",
"default": "autoscaler#zoneList"
},
"nextPageToken": {
"type": "string"
},
"selfLink": {
"type": "string",
"description": "Server defined URL for this resource (output only)."
}
}
}
},
"resources": {
"autoscalers": {
"methods": {
"delete": {
"id": "autoscaler.autoscalers.delete",
"path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
"httpMethod": "DELETE",
"description": "Deletes the specified Autoscaler resource.",
"parameters": {
"autoscaler": {
"type": "string",
"description": "Name of the Autoscaler resource.",
"required": true,
"location": "path"
},
"project": {
"type": "string",
"description": "Project ID of Autoscaler resource.",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "Zone name of Autoscaler resource.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"zone",
"autoscaler"
],
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/compute"
]
},
"get": {
"id": "autoscaler.autoscalers.get",
"path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
"httpMethod": "GET",
"description": "Gets the specified Autoscaler resource.",
"parameters": {
"autoscaler": {
"type": "string",
"description": "Name of the Autoscaler resource.",
"required": true,
"location": "path"
},
"project": {
"type": "string",
"description": "Project ID of Autoscaler resource.",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "Zone name of Autoscaler resource.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"zone",
"autoscaler"
],
"response": {
"$ref": "Autoscaler"
},
"scopes": [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
},
"insert": {
"id": "autoscaler.autoscalers.insert",
"path": "projects/{project}/zones/{zone}/autoscalers",
"httpMethod": "POST",
"description": "Adds new Autoscaler resource.",
"parameters": {
"project": {
"type": "string",
"description": "Project ID of Autoscaler resource.",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "Zone name of Autoscaler resource.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"zone"
],
"request": {
"$ref": "Autoscaler"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/compute"
]
},
"list": {
"id": "autoscaler.autoscalers.list",
"path": "projects/{project}/zones/{zone}/autoscalers",
"httpMethod": "GET",
"description": "Lists all Autoscaler resources in this zone.",
"parameters": {
"filter": {
"type": "string",
"location": "query"
},
"maxResults": {
"type": "integer",
"default": "500",
"format": "uint32",
"minimum": "0",
"maximum": "500",
"location": "query"
},
"pageToken": {
"type": "string",
"location": "query"
},
"project": {
"type": "string",
"description": "Project ID of Autoscaler resource.",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "Zone name of Autoscaler resource.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"zone"
],
"response": {
"$ref": "AutoscalerListResponse"
},
"scopes": [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
},
"patch": {
"id": "autoscaler.autoscalers.patch",
"path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
"httpMethod": "PATCH",
"description": "Update the entire content of the Autoscaler resource. This method supports patch semantics.",
"parameters": {
"autoscaler": {
"type": "string",
"description": "Name of the Autoscaler resource.",
"required": true,
"location": "path"
},
"project": {
"type": "string",
"description": "Project ID of Autoscaler resource.",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "Zone name of Autoscaler resource.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"zone",
"autoscaler"
],
"request": {
"$ref": "Autoscaler"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/compute"
]
},
"update": {
"id": "autoscaler.autoscalers.update",
"path": "projects/{project}/zones/{zone}/autoscalers/{autoscaler}",
"httpMethod": "PUT",
"description": "Update the entire content of the Autoscaler resource.",
"parameters": {
"autoscaler": {
"type": "string",
"description": "Name of the Autoscaler resource.",
"required": true,
"location": "path"
},
"project": {
"type": "string",
"description": "Project ID of Autoscaler resource.",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "Zone name of Autoscaler resource.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"zone",
"autoscaler"
],
"request": {
"$ref": "Autoscaler"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/compute"
]
}
}
},
"zoneOperations": {
"methods": {
"delete": {
"id": "autoscaler.zoneOperations.delete",
"path": "{project}/zones/{zone}/operations/{operation}",
"httpMethod": "DELETE",
"description": "Deletes the specified zone-specific operation resource.",
"parameters": {
"operation": {
"type": "string",
"required": true,
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"location": "path"
},
"project": {
"type": "string",
"required": true,
"pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"location": "path"
},
"zone": {
"type": "string",
"required": true,
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"location": "path"
}
},
"parameterOrder": [
"project",
"zone",
"operation"
],
"scopes": [
"https://www.googleapis.com/auth/compute"
]
},
"get": {
"id": "autoscaler.zoneOperations.get",
"path": "{project}/zones/{zone}/operations/{operation}",
"httpMethod": "GET",
"description": "Retrieves the specified zone-specific operation resource.",
"parameters": {
"operation": {
"type": "string",
"required": true,
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"location": "path"
},
"project": {
"type": "string",
"required": true,
"pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"location": "path"
},
"zone": {
"type": "string",
"required": true,
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"location": "path"
}
},
"parameterOrder": [
"project",
"zone",
"operation"
],
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
},
"list": {
"id": "autoscaler.zoneOperations.list",
"path": "{project}/zones/{zone}/operations",
"httpMethod": "GET",
"description": "Retrieves the list of operation resources contained within the specified zone.",
"parameters": {
"filter": {
"type": "string",
"location": "query"
},
"maxResults": {
"type": "integer",
"default": "500",
"format": "uint32",
"minimum": "0",
"maximum": "500",
"location": "query"
},
"pageToken": {
"type": "string",
"location": "query"
},
"project": {
"type": "string",
"required": true,
"pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"location": "path"
},
"zone": {
"type": "string",
"required": true,
"pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
"location": "path"
}
},
"parameterOrder": [
"project",
"zone"
],
"response": {
"$ref": "OperationList"
},
"scopes": [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
}
}
},
"zones": {
"methods": {
"list": {
"id": "autoscaler.zones.list",
"path": "{project}/zones",
"httpMethod": "GET",
"description": "",
"parameters": {
"filter": {
"type": "string",
"location": "query"
},
"maxResults": {
"type": "integer",
"default": "500",
"format": "uint32",
"minimum": "0",
"maximum": "500",
"location": "query"
},
"pageToken": {
"type": "string",
"location": "query"
},
"project": {
"type": "string",
"required": true,
"pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
"location": "path"
}
},
"parameterOrder": [
"project"
],
"response": {
"$ref": "ZoneList"
},
"scopes": [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/compute.readonly"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,923 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"uUWyYHXmEn-ab7WLvo8qNz2S8ws/sAKs5msKBJR7SX4fg3Ahfyr5uno\"",
"discoveryVersion": "v1",
"id": "blogger:v2",
"name": "blogger",
"version": "v2",
"revision": "20140827",
"title": "Blogger API",
"description": "API for access to the data within Blogger.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "https://www.google.com/images/icons/product/blogger-16.png",
"x32": "https://www.google.com/images/icons/product/blogger-32.png"
},
"documentationLink": "https://developers.google.com/blogger/docs/2.0/json/getting_started",
"labels": [
"limited_availability"
],
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/blogger/v2/",
"basePath": "/blogger/v2/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "blogger/v2/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/blogger": {
"description": "Manage your Blogger account"
}
}
}
},
"schemas": {
"Blog": {
"id": "Blog",
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "The description of this blog. This is displayed underneath the title."
},
"id": {
"type": "string",
"description": "The identifier for this resource.",
"format": "int64"
},
"kind": {
"type": "string",
"description": "The kind of this entry. Always blogger#blog",
"default": "blogger#blog"
},
"locale": {
"type": "object",
"description": "The locale this Blog is set to.",
"properties": {
"country": {
"type": "string",
"description": "The country this blog's locale is set to."
},
"language": {
"type": "string",
"description": "The language this blog is authored in."
},
"variant": {
"type": "string",
"description": "The language variant this blog is authored in."
}
}
},
"name": {
"type": "string",
"description": "The name of this blog. This is displayed as the title."
},
"pages": {
"type": "object",
"description": "The container of pages in this blog.",
"properties": {
"selfLink": {
"type": "string",
"description": "The URL of the container for pages in this blog."
},
"totalItems": {
"type": "integer",
"description": "The count of pages in this blog.",
"format": "int32"
}
}
},
"posts": {
"type": "object",
"description": "The container of posts in this blog.",
"properties": {
"selfLink": {
"type": "string",
"description": "The URL of the container for posts in this blog."
},
"totalItems": {
"type": "integer",
"description": "The count of posts in this blog.",
"format": "int32"
}
}
},
"published": {
"type": "string",
"description": "RFC 3339 date-time when this blog was published.",
"format": "date-time"
},
"selfLink": {
"type": "string",
"description": "The API REST URL to fetch this resource from."
},
"updated": {
"type": "string",
"description": "RFC 3339 date-time when this blog was last updated.",
"format": "date-time"
},
"url": {
"type": "string",
"description": "The URL where this blog is published."
}
}
},
"BlogList": {
"id": "BlogList",
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "The list of Blogs this user has Authorship or Admin rights over.",
"items": {
"$ref": "Blog"
}
},
"kind": {
"type": "string",
"description": "The kind of this entity. Always blogger#blogList",
"default": "blogger#blogList"
}
}
},
"Comment": {
"id": "Comment",
"type": "object",
"properties": {
"author": {
"type": "object",
"description": "The author of this Comment.",
"properties": {
"displayName": {
"type": "string",
"description": "The display name."
},
"id": {
"type": "string",
"description": "The identifier of the Comment creator."
},
"image": {
"type": "object",
"description": "The comment creator's avatar.",
"properties": {
"url": {
"type": "string",
"description": "The comment creator's avatar URL."
}
}
},
"url": {
"type": "string",
"description": "The URL of the Comment creator's Profile page."
}
}
},
"blog": {
"type": "object",
"description": "Data about the blog containing this comment.",
"properties": {
"id": {
"type": "string",
"description": "The identifier of the blog containing this comment.",
"format": "int64"
}
}
},
"content": {
"type": "string",
"description": "The actual content of the comment. May include HTML markup."
},
"id": {
"type": "string",
"description": "The identifier for this resource.",
"format": "int64"
},
"inReplyTo": {
"type": "object",
"description": "Data about the comment this is in reply to.",
"properties": {
"id": {
"type": "string",
"description": "The identified of the parent of this comment.",
"format": "int64"
}
}
},
"kind": {
"type": "string",
"description": "The kind of this entry. Always blogger#comment",
"default": "blogger#comment"
},
"post": {
"type": "object",
"description": "Data about the post containing this comment.",
"properties": {
"id": {
"type": "string",
"description": "The identifier of the post containing this comment.",
"format": "int64"
}
}
},
"published": {
"type": "string",
"description": "RFC 3339 date-time when this comment was published.",
"format": "date-time"
},
"selfLink": {
"type": "string",
"description": "The API REST URL to fetch this resource from."
},
"updated": {
"type": "string",
"description": "RFC 3339 date-time when this comment was last updated.",
"format": "date-time"
}
}
},
"CommentList": {
"id": "CommentList",
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "The List of Comments for a Post.",
"items": {
"$ref": "Comment"
}
},
"kind": {
"type": "string",
"description": "The kind of this entry. Always blogger#commentList",
"default": "blogger#commentList"
},
"nextPageToken": {
"type": "string",
"description": "Pagination token to fetch the next page, if one exists."
},
"prevPageToken": {
"type": "string",
"description": "Pagination token to fetch the previous page, if one exists."
}
}
},
"Page": {
"id": "Page",
"type": "object",
"properties": {
"author": {
"type": "object",
"description": "The author of this Page.",
"properties": {
"displayName": {
"type": "string",
"description": "The display name."
},
"id": {
"type": "string",
"description": "The identifier of the Page creator."
},
"image": {
"type": "object",
"description": "The page author's avatar.",
"properties": {
"url": {
"type": "string",
"description": "The page author's avatar URL."
}
}
},
"url": {
"type": "string",
"description": "The URL of the Page creator's Profile page."
}
}
},
"blog": {
"type": "object",
"description": "Data about the blog containing this Page.",
"properties": {
"id": {
"type": "string",
"description": "The identifier of the blog containing this page.",
"format": "int64"
}
}
},
"content": {
"type": "string",
"description": "The body content of this Page, in HTML."
},
"id": {
"type": "string",
"description": "The identifier for this resource.",
"format": "int64"
},
"kind": {
"type": "string",
"description": "The kind of this entity. Always blogger#page",
"default": "blogger#page"
},
"published": {
"type": "string",
"description": "RFC 3339 date-time when this Page was published.",
"format": "date-time"
},
"selfLink": {
"type": "string",
"description": "The API REST URL to fetch this resource from."
},
"title": {
"type": "string",
"description": "The title of this entity. This is the name displayed in the Admin user interface."
},
"updated": {
"type": "string",
"description": "RFC 3339 date-time when this Page was last updated.",
"format": "date-time"
},
"url": {
"type": "string",
"description": "The URL that this Page is displayed at."
}
}
},
"PageList": {
"id": "PageList",
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "The list of Pages for a Blog.",
"items": {
"$ref": "Page"
}
},
"kind": {
"type": "string",
"description": "The kind of this entity. Always blogger#pageList",
"default": "blogger#pageList"
}
}
},
"Post": {
"id": "Post",
"type": "object",
"properties": {
"author": {
"type": "object",
"description": "The author of this Post.",
"properties": {
"displayName": {
"type": "string",
"description": "The display name."
},
"id": {
"type": "string",
"description": "The identifier of the Post creator."
},
"image": {
"type": "object",
"description": "The Post author's avatar.",
"properties": {
"url": {
"type": "string",
"description": "The Post author's avatar URL."
}
}
},
"url": {
"type": "string",
"description": "The URL of the Post creator's Profile page."
}
}
},
"blog": {
"type": "object",
"description": "Data about the blog containing this Post.",
"properties": {
"id": {
"type": "string",
"description": "The identifier of the Blog that contains this Post.",
"format": "int64"
}
}
},
"content": {
"type": "string",
"description": "The content of the Post. May contain HTML markup."
},
"id": {
"type": "string",
"description": "The identifier of this Post.",
"format": "int64"
},
"kind": {
"type": "string",
"description": "The kind of this entity. Always blogger#post",
"default": "blogger#post"
},
"labels": {
"type": "array",
"description": "The list of labels this Post was tagged with.",
"items": {
"type": "string"
}
},
"published": {
"type": "string",
"description": "RFC 3339 date-time when this Post was published.",
"format": "date-time"
},
"replies": {
"type": "object",
"description": "The container of comments on this Post.",
"properties": {
"selfLink": {
"type": "string",
"description": "The URL of the comments on this post."
},
"totalItems": {
"type": "string",
"description": "The count of comments on this post.",
"format": "int64"
}
}
},
"selfLink": {
"type": "string",
"description": "The API REST URL to fetch this resource from."
},
"title": {
"type": "string",
"description": "The title of the Post."
},
"updated": {
"type": "string",
"description": "RFC 3339 date-time when this Post was last updated.",
"format": "date-time"
},
"url": {
"type": "string",
"description": "The URL where this Post is displayed."
}
}
},
"PostList": {
"id": "PostList",
"type": "object",
"properties": {
"items": {
"type": "array",
"description": "The list of Posts for this Blog.",
"items": {
"$ref": "Post"
}
},
"kind": {
"type": "string",
"description": "The kind of this entity. Always blogger#postList",
"default": "blogger#postList"
},
"nextPageToken": {
"type": "string",
"description": "Pagination token to fetch the next page, if one exists."
},
"prevPageToken": {
"type": "string",
"description": "Pagination token to fetch the previous page, if one exists."
}
}
},
"User": {
"id": "User",
"type": "object",
"properties": {
"about": {
"type": "string",
"description": "Profile summary information."
},
"blogs": {
"type": "object",
"description": "The container of blogs for this user.",
"properties": {
"selfLink": {
"type": "string",
"description": "The URL of the Blogs for this user."
}
}
},
"created": {
"type": "string",
"description": "The timestamp of when this profile was created, in seconds since epoch.",
"format": "date-time"
},
"displayName": {
"type": "string",
"description": "The display name."
},
"id": {
"type": "string",
"description": "The identifier for this User."
},
"kind": {
"type": "string",
"description": "The kind of this entity. Always blogger#user",
"default": "blogger#user"
},
"locale": {
"type": "object",
"description": "This user's locale",
"properties": {
"country": {
"type": "string",
"description": "The user's country setting."
},
"language": {
"type": "string",
"description": "The user's language setting."
},
"variant": {
"type": "string",
"description": "The user's language variant setting."
}
}
},
"selfLink": {
"type": "string",
"description": "The API REST URL to fetch this resource from."
},
"url": {
"type": "string",
"description": "The user's profile page."
}
}
}
},
"resources": {
"blogs": {
"methods": {
"get": {
"id": "blogger.blogs.get",
"path": "blogs/{blogId}",
"httpMethod": "GET",
"description": "Gets one blog by id.",
"parameters": {
"blogId": {
"type": "string",
"description": "The ID of the blog to get.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"blogId"
],
"response": {
"$ref": "Blog"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
}
}
},
"comments": {
"methods": {
"get": {
"id": "blogger.comments.get",
"path": "blogs/{blogId}/posts/{postId}/comments/{commentId}",
"httpMethod": "GET",
"description": "Gets one comment by id.",
"parameters": {
"blogId": {
"type": "string",
"description": "ID of the blog to containing the comment.",
"required": true,
"location": "path"
},
"commentId": {
"type": "string",
"description": "The ID of the comment to get.",
"required": true,
"location": "path"
},
"postId": {
"type": "string",
"description": "ID of the post to fetch posts from.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"blogId",
"postId",
"commentId"
],
"response": {
"$ref": "Comment"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
},
"list": {
"id": "blogger.comments.list",
"path": "blogs/{blogId}/posts/{postId}/comments",
"httpMethod": "GET",
"description": "Retrieves the comments for a blog, possibly filtered.",
"parameters": {
"blogId": {
"type": "string",
"description": "ID of the blog to fetch comments from.",
"required": true,
"location": "path"
},
"fetchBodies": {
"type": "boolean",
"description": "Whether the body content of the comments is included.",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Maximum number of comments to include in the result.",
"format": "uint32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Continuation token if request is paged.",
"location": "query"
},
"postId": {
"type": "string",
"description": "ID of the post to fetch posts from.",
"required": true,
"location": "path"
},
"startDate": {
"type": "string",
"description": "Earliest date of comment to fetch, a date-time with RFC 3339 formatting.",
"format": "date-time",
"location": "query"
}
},
"parameterOrder": [
"blogId",
"postId"
],
"response": {
"$ref": "CommentList"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
}
}
},
"pages": {
"methods": {
"get": {
"id": "blogger.pages.get",
"path": "blogs/{blogId}/pages/{pageId}",
"httpMethod": "GET",
"description": "Gets one blog page by id.",
"parameters": {
"blogId": {
"type": "string",
"description": "ID of the blog containing the page.",
"required": true,
"location": "path"
},
"pageId": {
"type": "string",
"description": "The ID of the page to get.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"blogId",
"pageId"
],
"response": {
"$ref": "Page"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
},
"list": {
"id": "blogger.pages.list",
"path": "blogs/{blogId}/pages",
"httpMethod": "GET",
"description": "Retrieves pages for a blog, possibly filtered.",
"parameters": {
"blogId": {
"type": "string",
"description": "ID of the blog to fetch pages from.",
"required": true,
"location": "path"
},
"fetchBodies": {
"type": "boolean",
"description": "Whether to retrieve the Page bodies.",
"location": "query"
}
},
"parameterOrder": [
"blogId"
],
"response": {
"$ref": "PageList"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
}
}
},
"posts": {
"methods": {
"get": {
"id": "blogger.posts.get",
"path": "blogs/{blogId}/posts/{postId}",
"httpMethod": "GET",
"description": "Get a post by id.",
"parameters": {
"blogId": {
"type": "string",
"description": "ID of the blog to fetch the post from.",
"required": true,
"location": "path"
},
"postId": {
"type": "string",
"description": "The ID of the post",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"blogId",
"postId"
],
"response": {
"$ref": "Post"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
},
"list": {
"id": "blogger.posts.list",
"path": "blogs/{blogId}/posts",
"httpMethod": "GET",
"description": "Retrieves a list of posts, possibly filtered.",
"parameters": {
"blogId": {
"type": "string",
"description": "ID of the blog to fetch posts from.",
"required": true,
"location": "path"
},
"fetchBodies": {
"type": "boolean",
"description": "Whether the body content of posts is included.",
"location": "query"
},
"maxResults": {
"type": "integer",
"description": "Maximum number of posts to fetch.",
"format": "uint32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "Continuation token if the request is paged.",
"location": "query"
},
"startDate": {
"type": "string",
"description": "Earliest post date to fetch, a date-time with RFC 3339 formatting.",
"format": "date-time",
"location": "query"
}
},
"parameterOrder": [
"blogId"
],
"response": {
"$ref": "PostList"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
}
}
},
"users": {
"methods": {
"get": {
"id": "blogger.users.get",
"path": "users/{userId}",
"httpMethod": "GET",
"description": "Gets one user by id.",
"parameters": {
"userId": {
"type": "string",
"description": "The ID of the user to get.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"userId"
],
"response": {
"$ref": "User"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
}
},
"resources": {
"blogs": {
"methods": {
"list": {
"id": "blogger.users.blogs.list",
"path": "users/{userId}/blogs",
"httpMethod": "GET",
"description": "Retrieves a list of blogs, possibly filtered.",
"parameters": {
"userId": {
"type": "string",
"description": "ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"userId"
],
"response": {
"$ref": "BlogList"
},
"scopes": [
"https://www.googleapis.com/auth/blogger"
]
}
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,343 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/vc2WYrePuDcqazgNVjmdzE5Mns4\"",
"discoveryVersion": "v1",
"id": "cloudbilling:v1",
"name": "cloudbilling",
"version": "v1",
"revision": "20150903",
"title": "Google Cloud Billing API",
"description": "Retrieves Google Developers Console billing accounts and associates them with projects.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/billing/",
"protocol": "rest",
"baseUrl": "https://cloudbilling.googleapis.com/",
"basePath": "/",
"rootUrl": "https://cloudbilling.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
}
}
}
},
"schemas": {
"BillingAccount": {
"id": "BillingAccount",
"type": "object",
"description": "A billing account in [Google Developers Console](https://console.developers.google.com/). You can assign a billing account to one or more projects.",
"properties": {
"name": {
"type": "string",
"description": "The resource name of the billing account. The resource name has the form `billingAccounts/{billing_account_id}`. For example, `billingAccounts/012345-567890-ABCDEF` would be the resource name for billing account `012345-567890-ABCDEF`."
},
"open": {
"type": "boolean",
"description": "True if the billing account is open, and will therefore be charged for any usage on associated projects. False if the billing account is closed, and therefore projects associated with it will be unable to use paid services."
},
"displayName": {
"type": "string",
"description": "The display name given to the billing account, such as `My Billing Account`. This name is displayed in the Google Developers Console."
}
}
},
"ListBillingAccountsResponse": {
"id": "ListBillingAccountsResponse",
"type": "object",
"description": "Response message for `ListBillingAccounts`.",
"properties": {
"billingAccounts": {
"type": "array",
"description": "A list of billing accounts.",
"items": {
"$ref": "BillingAccount"
}
},
"nextPageToken": {
"type": "string",
"description": "A token to retrieve the next page of results. To retrieve the next page, call `ListBillingAccounts` again with the `page_token` field set to this value. This field is empty if there are no more results to retrieve."
}
}
},
"ListProjectBillingInfoResponse": {
"id": "ListProjectBillingInfoResponse",
"type": "object",
"description": "Request message for `ListProjectBillingInfoResponse`.",
"properties": {
"projectBillingInfo": {
"type": "array",
"description": "A list of `ProjectBillingInfo` resources representing the projects associated with the billing account.",
"items": {
"$ref": "ProjectBillingInfo"
}
},
"nextPageToken": {
"type": "string",
"description": "A token to retrieve the next page of results. To retrieve the next page, call `ListProjectBillingInfo` again with the `page_token` field set to this value. This field is empty if there are no more results to retrieve."
}
}
},
"ProjectBillingInfo": {
"id": "ProjectBillingInfo",
"type": "object",
"description": "Encapsulation of billing information for a Developers Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).",
"properties": {
"name": {
"type": "string",
"description": "The resource name for the `ProjectBillingInfo`; has the form `projects/{project_id}/billingInfo`. For example, the resource name for the billing information for project `tokyo-rain-123` would be `projects/tokyo-rain-123/billingInfo`. This field is read-only."
},
"projectId": {
"type": "string",
"description": "The ID of the project that this `ProjectBillingInfo` represents, such as `tokyo-rain-123`. This is a convenience field so that you don't need to parse the `name` field to obtain a project ID. This field is read-only."
},
"billingAccountName": {
"type": "string",
"description": "The resource name of the billing account associated with the project, if any. For example, `billingAccounts/012345-567890-ABCDEF`."
},
"billingEnabled": {
"type": "boolean",
"description": "True if the project is associated with an open billing account, to which usage on the project is charged. False if the project is associated with a closed billing account, or no billing account at all, and therefore cannot use paid services. This field is read-only."
}
}
}
},
"resources": {
"billingAccounts": {
"methods": {
"get": {
"id": "cloudbilling.billingAccounts.get",
"path": "v1/{+name}",
"httpMethod": "GET",
"description": "Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).",
"parameters": {
"name": {
"type": "string",
"description": "The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`.",
"required": true,
"pattern": "^billingAccounts/[^/]*$",
"location": "path"
}
},
"parameterOrder": [
"name"
],
"response": {
"$ref": "BillingAccount"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"list": {
"id": "cloudbilling.billingAccounts.list",
"path": "v1/billingAccounts",
"httpMethod": "GET",
"description": "Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947).",
"parameters": {
"pageSize": {
"type": "integer",
"description": "Requested page size. The maximum page size is 100; this is also the default.",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned.",
"location": "query"
}
},
"response": {
"$ref": "ListBillingAccountsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
},
"resources": {
"projects": {
"methods": {
"list": {
"id": "cloudbilling.billingAccounts.projects.list",
"path": "v1/{+name}/projects",
"httpMethod": "GET",
"description": "Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).",
"parameters": {
"name": {
"type": "string",
"description": "The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`.",
"required": true,
"pattern": "^billingAccounts/[^/]*$",
"location": "path"
},
"pageSize": {
"type": "integer",
"description": "Requested page size. The maximum page size is 100; this is also the default.",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned.",
"location": "query"
}
},
"parameterOrder": [
"name"
],
"response": {
"$ref": "ListProjectBillingInfoResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
},
"projects": {
"methods": {
"getBillingInfo": {
"id": "cloudbilling.projects.getBillingInfo",
"path": "v1/{+name}/billingInfo",
"httpMethod": "GET",
"description": "Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ).",
"parameters": {
"name": {
"type": "string",
"description": "The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`.",
"required": true,
"pattern": "^projects/[^/]*$",
"location": "path"
}
},
"parameterOrder": [
"name"
],
"response": {
"$ref": "ProjectBillingInfo"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"updateBillingInfo": {
"id": "cloudbilling.projects.updateBillingInfo",
"path": "v1/{+name}/billingInfo",
"httpMethod": "PUT",
"description": "Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the Google Developers Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.",
"parameters": {
"name": {
"type": "string",
"description": "The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`.",
"required": true,
"pattern": "^projects/[^/]*$",
"location": "path"
}
},
"parameterOrder": [
"name"
],
"request": {
"$ref": "ProjectBillingInfo"
},
"response": {
"$ref": "ProjectBillingInfo"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
}

View file

@ -1,982 +0,0 @@
// Package cloudbilling provides access to the Google Cloud Billing API.
//
// See https://cloud.google.com/billing/
//
// Usage example:
//
// import "google.golang.org/api/cloudbilling/v1"
// ...
// cloudbillingService, err := cloudbilling.New(oauthHttpClient)
package cloudbilling // import "google.golang.org/api/cloudbilling/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "cloudbilling:v1"
const apiName = "cloudbilling"
const apiVersion = "v1"
const basePath = "https://cloudbilling.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.BillingAccounts = NewBillingAccountsService(s)
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
BillingAccounts *BillingAccountsService
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewBillingAccountsService(s *Service) *BillingAccountsService {
rs := &BillingAccountsService{s: s}
rs.Projects = NewBillingAccountsProjectsService(s)
return rs
}
type BillingAccountsService struct {
s *Service
Projects *BillingAccountsProjectsService
}
func NewBillingAccountsProjectsService(s *Service) *BillingAccountsProjectsService {
rs := &BillingAccountsProjectsService{s: s}
return rs
}
type BillingAccountsProjectsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
return rs
}
type ProjectsService struct {
s *Service
}
// BillingAccount: A billing account in [Google Developers
// Console](https://console.developers.google.com/). You can assign a
// billing account to one or more projects.
type BillingAccount struct {
// DisplayName: The display name given to the billing account, such as
// `My Billing Account`. This name is displayed in the Google Developers
// Console.
DisplayName string `json:"displayName,omitempty"`
// Name: The resource name of the billing account. The resource name has
// the form `billingAccounts/{billing_account_id}`. For example,
// `billingAccounts/012345-567890-ABCDEF` would be the resource name for
// billing account `012345-567890-ABCDEF`.
Name string `json:"name,omitempty"`
// Open: True if the billing account is open, and will therefore be
// charged for any usage on associated projects. False if the billing
// account is closed, and therefore projects associated with it will be
// unable to use paid services.
Open bool `json:"open,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DisplayName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *BillingAccount) MarshalJSON() ([]byte, error) {
type noMethod BillingAccount
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ListBillingAccountsResponse: Response message for
// `ListBillingAccounts`.
type ListBillingAccountsResponse struct {
// BillingAccounts: A list of billing accounts.
BillingAccounts []*BillingAccount `json:"billingAccounts,omitempty"`
// NextPageToken: A token to retrieve the next page of results. To
// retrieve the next page, call `ListBillingAccounts` again with the
// `page_token` field set to this value. This field is empty if there
// are no more results to retrieve.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BillingAccounts") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ListBillingAccountsResponse) MarshalJSON() ([]byte, error) {
type noMethod ListBillingAccountsResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ListProjectBillingInfoResponse: Request message for
// `ListProjectBillingInfoResponse`.
type ListProjectBillingInfoResponse struct {
// NextPageToken: A token to retrieve the next page of results. To
// retrieve the next page, call `ListProjectBillingInfo` again with the
// `page_token` field set to this value. This field is empty if there
// are no more results to retrieve.
NextPageToken string `json:"nextPageToken,omitempty"`
// ProjectBillingInfo: A list of `ProjectBillingInfo` resources
// representing the projects associated with the billing account.
ProjectBillingInfo []*ProjectBillingInfo `json:"projectBillingInfo,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ListProjectBillingInfoResponse) MarshalJSON() ([]byte, error) {
type noMethod ListProjectBillingInfoResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ProjectBillingInfo: Encapsulation of billing information for a
// Developers Console project. A project has at most one associated
// billing account at a time (but a billing account can be assigned to
// multiple projects).
type ProjectBillingInfo struct {
// BillingAccountName: The resource name of the billing account
// associated with the project, if any. For example,
// `billingAccounts/012345-567890-ABCDEF`.
BillingAccountName string `json:"billingAccountName,omitempty"`
// BillingEnabled: True if the project is associated with an open
// billing account, to which usage on the project is charged. False if
// the project is associated with a closed billing account, or no
// billing account at all, and therefore cannot use paid services. This
// field is read-only.
BillingEnabled bool `json:"billingEnabled,omitempty"`
// Name: The resource name for the `ProjectBillingInfo`; has the form
// `projects/{project_id}/billingInfo`. For example, the resource name
// for the billing information for project `tokyo-rain-123` would be
// `projects/tokyo-rain-123/billingInfo`. This field is read-only.
Name string `json:"name,omitempty"`
// ProjectId: The ID of the project that this `ProjectBillingInfo`
// represents, such as `tokyo-rain-123`. This is a convenience field so
// that you don't need to parse the `name` field to obtain a project ID.
// This field is read-only.
ProjectId string `json:"projectId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BillingAccountName")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ProjectBillingInfo) MarshalJSON() ([]byte, error) {
type noMethod ProjectBillingInfo
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "cloudbilling.billingAccounts.get":
type BillingAccountsGetCall struct {
s *Service
name string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Gets information about a billing account. The current
// authenticated user must be an [owner of the billing
// account](https://support.google.com/cloud/answer/4430947).
func (r *BillingAccountsService) Get(name string) *BillingAccountsGetCall {
c := &BillingAccountsGetCall{s: r.s, opt_: make(map[string]interface{})}
c.name = name
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BillingAccountsGetCall) Fields(s ...googleapi.Field) *BillingAccountsGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BillingAccountsGetCall) IfNoneMatch(entityTag string) *BillingAccountsGetCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *BillingAccountsGetCall) Context(ctx context.Context) *BillingAccountsGetCall {
c.ctx_ = ctx
return c
}
func (c *BillingAccountsGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "v1/{+name}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudbilling.billingAccounts.get" call.
// Exactly one of *BillingAccount or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *BillingAccount.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 *BillingAccountsGetCall) Do() (*BillingAccount, 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 := &BillingAccount{
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 information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).",
// "httpMethod": "GET",
// "id": "cloudbilling.billingAccounts.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`.",
// "location": "path",
// "pattern": "^billingAccounts/[^/]*$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}",
// "response": {
// "$ref": "BillingAccount"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudbilling.billingAccounts.list":
type BillingAccountsListCall struct {
s *Service
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Lists the billing accounts that the current authenticated user
// [owns](https://support.google.com/cloud/answer/4430947).
func (r *BillingAccountsService) List() *BillingAccountsListCall {
c := &BillingAccountsListCall{s: r.s, opt_: make(map[string]interface{})}
return c
}
// PageSize sets the optional parameter "pageSize": Requested page size.
// The maximum page size is 100; this is also the default.
func (c *BillingAccountsListCall) PageSize(pageSize int64) *BillingAccountsListCall {
c.opt_["pageSize"] = pageSize
return c
}
// PageToken sets the optional parameter "pageToken": A token
// identifying a page of results to return. This should be a
// `next_page_token` value returned from a previous
// `ListBillingAccounts` call. If unspecified, the first page of results
// is returned.
func (c *BillingAccountsListCall) PageToken(pageToken string) *BillingAccountsListCall {
c.opt_["pageToken"] = pageToken
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BillingAccountsListCall) Fields(s ...googleapi.Field) *BillingAccountsListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BillingAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsListCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *BillingAccountsListCall) Context(ctx context.Context) *BillingAccountsListCall {
c.ctx_ = ctx
return c
}
func (c *BillingAccountsListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["pageSize"]; ok {
params.Set("pageSize", 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, "v1/billingAccounts")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudbilling.billingAccounts.list" call.
// Exactly one of *ListBillingAccountsResponse or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *ListBillingAccountsResponse.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 *BillingAccountsListCall) Do() (*ListBillingAccountsResponse, 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 := &ListBillingAccountsResponse{
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": "Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947).",
// "httpMethod": "GET",
// "id": "cloudbilling.billingAccounts.list",
// "parameters": {
// "pageSize": {
// "description": "Requested page size. The maximum page size is 100; this is also the default.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/billingAccounts",
// "response": {
// "$ref": "ListBillingAccountsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudbilling.billingAccounts.projects.list":
type BillingAccountsProjectsListCall struct {
s *Service
name string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: Lists the projects associated with a billing account. The
// current authenticated user must be an [owner of the billing
// account](https://support.google.com/cloud/answer/4430947).
func (r *BillingAccountsProjectsService) List(name string) *BillingAccountsProjectsListCall {
c := &BillingAccountsProjectsListCall{s: r.s, opt_: make(map[string]interface{})}
c.name = name
return c
}
// PageSize sets the optional parameter "pageSize": Requested page size.
// The maximum page size is 100; this is also the default.
func (c *BillingAccountsProjectsListCall) PageSize(pageSize int64) *BillingAccountsProjectsListCall {
c.opt_["pageSize"] = pageSize
return c
}
// PageToken sets the optional parameter "pageToken": A token
// identifying a page of results to be returned. This should be a
// `next_page_token` value returned from a previous
// `ListProjectBillingInfo` call. If unspecified, the first page of
// results is returned.
func (c *BillingAccountsProjectsListCall) PageToken(pageToken string) *BillingAccountsProjectsListCall {
c.opt_["pageToken"] = pageToken
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *BillingAccountsProjectsListCall) Fields(s ...googleapi.Field) *BillingAccountsProjectsListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *BillingAccountsProjectsListCall) IfNoneMatch(entityTag string) *BillingAccountsProjectsListCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *BillingAccountsProjectsListCall) Context(ctx context.Context) *BillingAccountsProjectsListCall {
c.ctx_ = ctx
return c
}
func (c *BillingAccountsProjectsListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["pageSize"]; ok {
params.Set("pageSize", 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, "v1/{+name}/projects")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudbilling.billingAccounts.projects.list" call.
// Exactly one of *ListProjectBillingInfoResponse or error will be
// non-nil. Any non-2xx status code is an error. Response headers are in
// either *ListProjectBillingInfoResponse.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 *BillingAccountsProjectsListCall) Do() (*ListProjectBillingInfoResponse, 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 := &ListProjectBillingInfoResponse{
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": "Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).",
// "httpMethod": "GET",
// "id": "cloudbilling.billingAccounts.projects.list",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`.",
// "location": "path",
// "pattern": "^billingAccounts/[^/]*$",
// "required": true,
// "type": "string"
// },
// "pageSize": {
// "description": "Requested page size. The maximum page size is 100; this is also the default.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/{+name}/projects",
// "response": {
// "$ref": "ListProjectBillingInfoResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudbilling.projects.getBillingInfo":
type ProjectsGetBillingInfoCall struct {
s *Service
name string
opt_ map[string]interface{}
ctx_ context.Context
}
// GetBillingInfo: Gets the billing information for a project. The
// current authenticated user must have [permission to view the
// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxof
// vnoo ).
func (r *ProjectsService) GetBillingInfo(name string) *ProjectsGetBillingInfoCall {
c := &ProjectsGetBillingInfoCall{s: r.s, opt_: make(map[string]interface{})}
c.name = name
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsGetBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsGetBillingInfoCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsGetBillingInfoCall) IfNoneMatch(entityTag string) *ProjectsGetBillingInfoCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *ProjectsGetBillingInfoCall) Context(ctx context.Context) *ProjectsGetBillingInfoCall {
c.ctx_ = ctx
return c
}
func (c *ProjectsGetBillingInfoCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "v1/{+name}/billingInfo")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudbilling.projects.getBillingInfo" call.
// Exactly one of *ProjectBillingInfo or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ProjectBillingInfo.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 *ProjectsGetBillingInfoCall) Do() (*ProjectBillingInfo, 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 := &ProjectBillingInfo{
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 the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ).",
// "httpMethod": "GET",
// "id": "cloudbilling.projects.getBillingInfo",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`.",
// "location": "path",
// "pattern": "^projects/[^/]*$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}/billingInfo",
// "response": {
// "$ref": "ProjectBillingInfo"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudbilling.projects.updateBillingInfo":
type ProjectsUpdateBillingInfoCall struct {
s *Service
name string
projectbillinginfo *ProjectBillingInfo
opt_ map[string]interface{}
ctx_ context.Context
}
// UpdateBillingInfo: Sets or updates the billing account associated
// with a project. You specify the new billing account by setting the
// `billing_account_name` in the `ProjectBillingInfo` resource to the
// resource name of a billing account. Associating a project with an
// open billing account enables billing on the project and allows
// charges for resource usage. If the project already had a billing
// account, this method changes the billing account used for resource
// usage charges. *Note:* Incurred charges that have not yet been
// reported in the transaction history of the Google Developers Console
// may be billed to the new billing account, even if the charge occurred
// before the new billing account was assigned to the project. The
// current authenticated user must have ownership privileges for both
// the
// [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxo
// fvnoo ) and the [billing
// account](https://support.google.com/cloud/answer/4430947). You can
// disable billing on the project by setting the `billing_account_name`
// field to empty. This action disassociates the current billing account
// from the project. Any billable activity of your in-use services will
// stop, and your application could stop functioning as expected. Any
// unbilled charges to date will be billed to the previously associated
// account. The current authenticated user must be either an owner of
// the project or an owner of the billing account for the project. Note
// that associating a project with a *closed* billing account will have
// much the same effect as disabling billing on the project: any paid
// resources used by the project will be shut down. Thus, unless you
// wish to disable billing, you should always call this method with the
// name of an *open* billing account.
func (r *ProjectsService) UpdateBillingInfo(name string, projectbillinginfo *ProjectBillingInfo) *ProjectsUpdateBillingInfoCall {
c := &ProjectsUpdateBillingInfoCall{s: r.s, opt_: make(map[string]interface{})}
c.name = name
c.projectbillinginfo = projectbillinginfo
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsUpdateBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsUpdateBillingInfoCall {
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.
func (c *ProjectsUpdateBillingInfoCall) Context(ctx context.Context) *ProjectsUpdateBillingInfoCall {
c.ctx_ = ctx
return c
}
func (c *ProjectsUpdateBillingInfoCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectbillinginfo)
if err != nil {
return nil, err
}
ctype := "application/json"
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, "v1/{+name}/billingInfo")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PUT", urls, body)
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudbilling.projects.updateBillingInfo" call.
// Exactly one of *ProjectBillingInfo or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ProjectBillingInfo.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 *ProjectsUpdateBillingInfoCall) Do() (*ProjectBillingInfo, 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 := &ProjectBillingInfo{
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": "Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the Google Developers Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.",
// "httpMethod": "PUT",
// "id": "cloudbilling.projects.updateBillingInfo",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`.",
// "location": "path",
// "pattern": "^projects/[^/]*$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/{+name}/billingInfo",
// "request": {
// "$ref": "ProjectBillingInfo"
// },
// "response": {
// "$ref": "ProjectBillingInfo"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}

View file

@ -1,913 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/IirqKiawPBlWznB4XZKKLikRaQQ\"",
"discoveryVersion": "v1",
"id": "clouddebugger:v2",
"name": "clouddebugger",
"version": "v2",
"revision": "20150725",
"title": "Google Cloud Debugger API",
"description": "Lets you examine the stack and variables of your running application without stopping or slowing it down.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/tools/cloud-debugger",
"protocol": "rest",
"baseUrl": "https://clouddebugger.googleapis.com/",
"basePath": "/",
"rootUrl": "https://clouddebugger.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
},
"https://www.googleapis.com/auth/cloud_debugger": {
"description": "Manage cloud debugger"
},
"https://www.googleapis.com/auth/cloud_debugletcontroller": {
"description": "Manage active breakpoints in cloud debugger"
}
}
}
},
"schemas": {
"RegisterDebuggeeRequest": {
"id": "RegisterDebuggeeRequest",
"type": "object",
"description": "The request to register a debuggee.",
"properties": {
"debuggee": {
"$ref": "Debuggee",
"description": "The debuggee information to register. The fields 'project', 'uniquifier', 'description' and 'agent_version' of the debuggee must be set."
}
}
},
"Debuggee": {
"id": "Debuggee",
"type": "object",
"description": "Represents the application to debug. The application may include one or more replicated processes executing the same code. Each of these processes is attached with a debugger agent, carrying out the debugging commands. The agents attached to the same debuggee are identified by using exactly the same fields' values when registering.",
"properties": {
"id": {
"type": "string",
"description": "Debuggee unique identifer generated by the server."
},
"project": {
"type": "string",
"description": "The project the debuggee is associated with. Use the project number when registering a Google Cloud Platform project."
},
"uniquifier": {
"type": "string",
"description": "The debuggee uniqifier within the project. Any string that id the application within the project can be used. Recomended to include environement and version or build id's."
},
"description": {
"type": "string",
"description": "A human readable description of the debuggee. Recommended to include human readable project name, environment name, and version information ."
},
"isInactive": {
"type": "boolean",
"description": "If set to true indicates that the debuggee has not been seen by the Controller service in the last active time period (defined by the server)."
},
"agentVersion": {
"type": "string",
"description": "Version ID of the agent release. The version ID is structured as following: \"domain/type/vmajor.minor\" (for example \"google.com/gcp-java/v1.1\")."
},
"isDisabled": {
"type": "boolean",
"description": "If set to true, indicates that the agent should disable itself and detach from the debuggee."
},
"status": {
"$ref": "StatusMessage",
"description": "Human readable message to be displayed to the user about this debuggee. Absense of this field indicates no message. The message can be either informational or error."
},
"sourceContexts": {
"type": "array",
"description": "Repository snapshots containing the source code of the project.",
"items": {
"$ref": "SourceContext"
}
},
"labels": {
"type": "object",
"description": "A set of custom debuggee properties, populated by the agent, to be displayed to the user.",
"additionalProperties": {
"type": "string"
}
}
}
},
"StatusMessage": {
"id": "StatusMessage",
"type": "object",
"description": "Represents a contextual status message. The message can indicate an error or informational status, and refer to specific parts of the containing object. For example, the Breakpoint.status field can indicate an error referring to the BREAKPOINT_SOURCE_LOCATION with the message \"Location not found\".",
"properties": {
"isError": {
"type": "boolean",
"description": "Distinguishes errors from informational messages."
},
"refersTo": {
"type": "string",
"description": "Reference to which the message applies.",
"enum": [
"UNSPECIFIED",
"BREAKPOINT_SOURCE_LOCATION",
"BREAKPOINT_CONDITION",
"BREAKPOINT_EXPRESSION",
"VARIABLE_NAME",
"VARIABLE_VALUE"
]
},
"description": {
"$ref": "FormatMessage",
"description": "Status message text."
}
}
},
"FormatMessage": {
"id": "FormatMessage",
"type": "object",
"description": "Represents a message with parameters.",
"properties": {
"format": {
"type": "string",
"description": "Format template of the message. The \"format\" uses placeholders \"$0\", \"$1\", etc. to reference parameters. \"$$\" can be used to denote the '$' character. Examples: \"Failed to load '$0' which helps debug $1 the first time it is loaded. Again, $0 is very important.\" \"Please pay $$10 to use $0 instead of $1.\""
},
"parameters": {
"type": "array",
"description": "Optional parameters to be embedded into the message.",
"items": {
"type": "string"
}
}
}
},
"SourceContext": {
"id": "SourceContext",
"type": "object",
"description": "A SourceContext is a reference to a tree of files. A SourceContext together with a path point to a unique revision of a single file or directory.",
"properties": {
"cloudRepo": {
"$ref": "CloudRepoSourceContext",
"description": "A SourceContext referring to a revision in a cloud repo."
},
"cloudWorkspace": {
"$ref": "CloudWorkspaceSourceContext",
"description": "A SourceContext referring to a snapshot in a cloud workspace."
},
"gerrit": {
"$ref": "GerritSourceContext",
"description": "A SourceContext referring to a Gerrit project."
},
"git": {
"$ref": "GitSourceContext",
"description": "A SourceContext referring to any third party Git repo (e.g. GitHub)."
}
}
},
"CloudRepoSourceContext": {
"id": "CloudRepoSourceContext",
"type": "object",
"description": "A CloudRepoSourceContext denotes a particular revision in a cloud repo (a repo hosted by the Google Cloud Platform).",
"properties": {
"repoId": {
"$ref": "RepoId",
"description": "The ID of the repo."
},
"revisionId": {
"type": "string",
"description": "A revision ID."
},
"aliasName": {
"type": "string",
"description": "The name of an alias (branch, tag, etc.)."
}
}
},
"RepoId": {
"id": "RepoId",
"type": "object",
"description": "A unique identifier for a cloud repo.",
"properties": {
"projectRepoId": {
"$ref": "ProjectRepoId",
"description": "A combination of a project ID and a repo name."
},
"uid": {
"type": "string",
"description": "A server-assigned, globally unique identifier."
}
}
},
"ProjectRepoId": {
"id": "ProjectRepoId",
"type": "object",
"description": "Selects a repo using a Google Cloud Platform project ID (e.g. winged-cargo-31) and a repo name within that project.",
"properties": {
"projectId": {
"type": "string",
"description": "The ID of the project."
},
"repoName": {
"type": "string",
"description": "The name of the repo. Leave empty for the default repo."
}
}
},
"CloudWorkspaceSourceContext": {
"id": "CloudWorkspaceSourceContext",
"type": "object",
"description": "A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot.",
"properties": {
"workspaceId": {
"$ref": "CloudWorkspaceId",
"description": "The ID of the workspace."
},
"snapshotId": {
"type": "string",
"description": "The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot."
}
}
},
"CloudWorkspaceId": {
"id": "CloudWorkspaceId",
"type": "object",
"description": "A CloudWorkspaceId is a unique identifier for a cloud workspace. A cloud workspace is a place associated with a repo where modified files can be stored before they are committed.",
"properties": {
"repoId": {
"$ref": "RepoId",
"description": "The ID of the repo containing the workspace."
},
"name": {
"type": "string",
"description": "The unique name of the workspace within the repo. This is the name chosen by the client in the Source API's CreateWorkspace method."
}
}
},
"GerritSourceContext": {
"id": "GerritSourceContext",
"type": "object",
"description": "A SourceContext referring to a Gerrit project.",
"properties": {
"hostUri": {
"type": "string",
"description": "The URI of a running Gerrit instance."
},
"gerritProject": {
"type": "string",
"description": "The full project name within the host. Projects may be nested, so \"project/subproject\" is a valid project name. The \"repo name\" is hostURI/project."
},
"revisionId": {
"type": "string",
"description": "A revision (commit) ID."
},
"aliasName": {
"type": "string",
"description": "The name of an alias (branch, tag, etc.)."
}
}
},
"GitSourceContext": {
"id": "GitSourceContext",
"type": "object",
"description": "A GitSourceContext denotes a particular revision in a third party Git repository (e.g. GitHub).",
"properties": {
"url": {
"type": "string",
"description": "Git repository URL."
},
"revisionId": {
"type": "string",
"description": "Git commit hash. required."
}
}
},
"RegisterDebuggeeResponse": {
"id": "RegisterDebuggeeResponse",
"type": "object",
"description": "The response of registering a debuggee.",
"properties": {
"debuggee": {
"$ref": "Debuggee",
"description": "The debuggee resource. The field 'id' is guranteed to be set (in addition to the echoed fields)."
}
}
},
"ListActiveBreakpointsResponse": {
"id": "ListActiveBreakpointsResponse",
"type": "object",
"description": "The response of listing active breakpoints.",
"properties": {
"breakpoints": {
"type": "array",
"description": "List of all active breakpoints. The fields 'id' and 'location' are guranteed to be set on each breakpoint.",
"items": {
"$ref": "Breakpoint"
}
},
"nextWaitToken": {
"type": "string",
"description": "A wait token that can be used in the next method call to block until the list of breakpoints changes."
}
}
},
"Breakpoint": {
"id": "Breakpoint",
"type": "object",
"description": "Represents the breakpoint specification, status and results.",
"properties": {
"id": {
"type": "string",
"description": "Breakpoint identifier, unique in the scope of the debuggee."
},
"action": {
"type": "string",
"description": "Defines what to do when the breakpoint hits.",
"enum": [
"CAPTURE",
"LOG"
]
},
"location": {
"$ref": "SourceLocation",
"description": "The breakpoint source location."
},
"condition": {
"type": "string",
"description": "A condition to trigger the breakpoint. The condition is a compound boolean expression composed using expressions in a programming language at the source location."
},
"expressions": {
"type": "array",
"description": "A list of read-only expressions to evaluate at the breakpoint location. The expressions are composed using expressions in the programming language at the source location. If the breakpoint action is \"LOG\", the evaluated expressions are included in log statements.",
"items": {
"type": "string"
}
},
"logMessageFormat": {
"type": "string",
"description": "Only relevant when action is \"LOG\". Defines the message to log when the breakpoint hits. The message may include parameter placeholders \"$0\", \"$1\", etc. These placeholders will be replaced with the evaluated value of the appropriate expression. Expressions not referenced in \"log_message_format\" will not be logged. Example: \"Poisonous message received, id = $0, count = $1\" with expressions = [ \"message.id\", \"message.count\" ]."
},
"logLevel": {
"type": "string",
"description": "Indicates the severity of the log. Only relevant when action is \"LOG\".",
"enum": [
"INFO",
"WARNING",
"ERROR"
]
},
"isFinalState": {
"type": "boolean",
"description": "When true, indicates that this is a final result and the breakpoint state will not change from here on."
},
"createTime": {
"type": "string",
"description": "The time this breakpoint was created by the server. The value is in seconds resolution."
},
"finalTime": {
"type": "string",
"description": "The time this breakpoint was finalized as seen by the server. The value is in seconds resolution."
},
"userEmail": {
"type": "string",
"description": "The e-mail of the user that created this breakpoint"
},
"status": {
"$ref": "StatusMessage",
"description": "Breakpoint status. The status includes an error flag and a human readable message. This field will usually stay unset. The message can be either informational or error. Nevertheless, clients should always display the text message back to the user. Error status of a breakpoint indicates complete failure. Example (non-final state): 'Still loading symbols...' Examples (final state): 'Failed to insert breakpoint' referring to breakpoint, 'Field f not found in class C' referring to condition, ..."
},
"stackFrames": {
"type": "array",
"description": "The stack at breakpoint time.",
"items": {
"$ref": "StackFrame"
}
},
"evaluatedExpressions": {
"type": "array",
"description": "The evaluated expressions' values at breakpoint time. The evaluated expressions appear in exactly the same order they are listed in the 'expressions' field. The 'name' field holds the original expression text, the 'value'/'members' field holds the result of the evaluated expression. If the expression can not be evaluated, an error text is placed in the value field.",
"items": {
"$ref": "Variable"
}
},
"variableTable": {
"type": "array",
"description": "The variable_table exists to aid with computation, memory and network traffic optimization. It enables storing a variable once and reference it from multiple variables, including variables stored in the variable_table itself. For example, the object 'this', which may appear at many levels of the stack, can have all of it's data stored once in this table. The stack frame variables then would hold only a reference to it. The variable var_index field is an index into this repeated field. The stored objects are nameless and get their name from the referencing variable. The effective variable is a merge of the referencing veariable and the referenced variable.",
"items": {
"$ref": "Variable"
}
}
}
},
"SourceLocation": {
"id": "SourceLocation",
"type": "object",
"description": "Represents a location in the source code.",
"properties": {
"path": {
"type": "string",
"description": "A path to the source file within the source context of the target binary."
},
"line": {
"type": "integer",
"description": "The line inside the file (first line value is '1').",
"format": "int32"
}
}
},
"StackFrame": {
"id": "StackFrame",
"type": "object",
"description": "Represents a stack frame context.",
"properties": {
"function": {
"type": "string",
"description": "The unmangled function name at the call site."
},
"location": {
"$ref": "SourceLocation",
"description": "The source location of the call site."
},
"arguments": {
"type": "array",
"description": "The set of arguments passed to this function Note that this might not be populated for all stack frames.",
"items": {
"$ref": "Variable"
}
},
"locals": {
"type": "array",
"description": "The set of local variables at the stack frame location. Note that this might not be populated for all stack frames.",
"items": {
"$ref": "Variable"
}
}
}
},
"Variable": {
"id": "Variable",
"type": "object",
"description": "Represents a variable or an argument possibly of a compound object type. 1. A simple variable such as, int x = 5 is represented as: { name: \"x\", value: \"5\" } 2. A compound object such as, struct T { int m1; int m2; }; T x = { 3, 7 }; is represented as: { name: \"x\", members { name: \"m1\", value: \"3\" }, members { name: \"m2\", value: \"7\" } } 3. A pointer where the pointee was captured such as, T x = { 3, 7 }; T* p = &x; is represented as: { name: \"p\", value: \"0x00500500\", members { name: \"m1\", value: \"3\" }, members { name: \"m2\", value: \"7\" } } 4. A pointer where the pointee was not captured or is inaccessible such as, T* p = new T; is represented as: { name: \"p\", value: \"0x00400400\", members { value: \"\" } } the value text should decribe the reason for the missing value. such as , ,\n. note that a null pointer should not have members. 5. An unnamed value such as, int* p = new int(7); is represented as, { name: \"p\", value: \"0x00500500\", members { value: \"7\" } } 6. An unnamed pointer where the pointee was not captured such as, int* p = new int(7); int** pp = &p; is represented as: { name: \"pp\", value: \"0x00500500\", members { value: \"0x00400400\", members { value: \"\" } } } To optimize computation, memory and network traffic, variables that repeat in the output multiple times can be stored once in a shared variable table and be referenced using the var_index field. The variables stored in the shared table are nameless and are essentially a partition of the complete variable. To reconstruct the complete variable merge the referencing variable with the referenced variable. When using the shared variable table, variables can be represented as: T x = { 3, 7 }; T* p = &x; T& r = x; are represented as, { name: \"x\", var_index: 3 } { name: \"p\", value \"0x00500500\", var_index: 3 } { name: \"r\", var_index: 3 } with shared variable table entry #3: { members { name: \"m1\", value: \"3\" }, members { name: \"m2\", value: \"7\" } } Note that the pointer address is stored with the referencing variable and not with the referenced variable, to allow the referenced variable to be shared between pointer and references.",
"properties": {
"name": {
"type": "string",
"description": "The name of the variable, if any."
},
"value": {
"type": "string",
"description": "The simple value of the variable."
},
"members": {
"type": "array",
"description": "The members contained or pointed to by the variable.",
"items": {
"$ref": "Variable"
}
},
"varTableIndex": {
"type": "integer",
"description": "This is a reference to a variable in the shared variable table. More than one variable can reference the same variable in the table. The var_index field is an index into variable_table in Breakpoint.",
"format": "int32"
},
"status": {
"$ref": "StatusMessage",
"description": "Status associated with the variable. This field will usually stay unset. A status of a single variable only applies to that variable or expression. The rest of breakpoint data still remains valid. Variables might be reported in error state even when breakpoint is not in final state. The message may refer to variable name with \"refers_to\" set to \"VARIABLE_NAME\". Alternatively \"refers_to\" will be set to \"VARIABLE_VALUE\". In either case variable value and members will be unset. Example of error message applied to name: \"Invalid expression syntax\". Example of information message applied to value: \"Not captured\". Examples of error message applied to value: \"Malformed string\", \"Field f not found in class C\", \"Null pointer dereference\"."
}
}
},
"UpdateActiveBreakpointRequest": {
"id": "UpdateActiveBreakpointRequest",
"type": "object",
"description": "The request to update an active breakpoint.",
"properties": {
"breakpoint": {
"$ref": "Breakpoint",
"description": "The updated breakpoint information. The field 'id' must be set."
}
}
},
"UpdateActiveBreakpointResponse": {
"id": "UpdateActiveBreakpointResponse",
"type": "object",
"description": "The response of updating an active breakpoint. The message is defined to allow future extensions."
},
"SetBreakpointResponse": {
"id": "SetBreakpointResponse",
"type": "object",
"description": "The response of setting a breakpoint.",
"properties": {
"breakpoint": {
"$ref": "Breakpoint",
"description": "The breakpoint resource. The field 'id' is guranteed to be set (in addition to the echoed fileds)."
}
}
},
"GetBreakpointResponse": {
"id": "GetBreakpointResponse",
"type": "object",
"description": "The response of getting breakpoint information.",
"properties": {
"breakpoint": {
"$ref": "Breakpoint",
"description": "The complete breakpoint state. The fields 'id' and 'location' are guranteed to be set."
}
}
},
"Empty": {
"id": "Empty",
"type": "object",
"description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`."
},
"ListBreakpointsResponse": {
"id": "ListBreakpointsResponse",
"type": "object",
"description": "The response of listing breakpoints.",
"properties": {
"breakpoints": {
"type": "array",
"description": "List of all breakpoints with complete state. The fields 'id' and 'location' are guranteed to be set on each breakpoint.",
"items": {
"$ref": "Breakpoint"
}
},
"nextWaitToken": {
"type": "string",
"description": "A wait token that can be used in the next call to ListBreakpoints to block until the list of breakpoints has changes."
}
}
},
"ListDebuggeesResponse": {
"id": "ListDebuggeesResponse",
"type": "object",
"description": "The response of listing debuggees.",
"properties": {
"debuggees": {
"type": "array",
"description": "The list of debuggees accessible to the calling user. Note that the description field is the only human readable field that should be displayed to the user. The fields 'debuggee.id' and 'description' are guranteed to be set on each debuggee.",
"items": {
"$ref": "Debuggee"
}
}
}
}
},
"resources": {
"controller": {
"resources": {
"debuggees": {
"methods": {
"register": {
"id": "clouddebugger.controller.debuggees.register",
"path": "v2/controller/debuggees/register",
"httpMethod": "POST",
"description": "Registers the debuggee with the controller. All agents should call this API with the same request content to get back the same stable 'debuggee_id'. Agents should call this API again whenever ListActiveBreakpoints or UpdateActiveBreakpoint return the error google.rpc.Code.NOT_FOUND. It allows the server to disable the agent or recover from any registration loss. If the debuggee is disabled server, the response will have is_disabled' set to true.",
"request": {
"$ref": "RegisterDebuggeeRequest"
},
"response": {
"$ref": "RegisterDebuggeeResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugletcontroller"
]
}
},
"resources": {
"breakpoints": {
"methods": {
"list": {
"id": "clouddebugger.controller.debuggees.breakpoints.list",
"path": "v2/controller/debuggees/{debuggeeId}/breakpoints",
"httpMethod": "GET",
"description": "Returns the list of all active breakpoints for the specified debuggee. The breakpoint specification (location, condition, and expression fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line the breakpoint was set to, but that doesn't change the breakpoint semantics. Thus, an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember breakpoints that are complete until the controller removes them from the active list to avoid setting those breakpoints again.",
"parameters": {
"debuggeeId": {
"type": "string",
"description": "Identifies the debuggee.",
"required": true,
"location": "path"
},
"waitToken": {
"type": "string",
"description": "A wait token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server selected timeout has expired. The value should be set from the last returned response. The error code google.rpc.Code.ABORTED is returned on wait timeout (which does not require the agent to re-register with the server)",
"location": "query"
}
},
"parameterOrder": [
"debuggeeId"
],
"response": {
"$ref": "ListActiveBreakpointsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugletcontroller"
]
},
"update": {
"id": "clouddebugger.controller.debuggees.breakpoints.update",
"path": "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}",
"httpMethod": "PUT",
"description": "Updates the breakpoint state or mutable fields. The entire Breakpoint protobuf must be sent back to the controller. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the 'location', 'condition' and 'expression' fields should not alter the breakpoint semantics. They are restricted to changes such as canonicalizing a value or snapping the location to the correct line of code.",
"parameters": {
"debuggeeId": {
"type": "string",
"description": "Identifies the debuggee being debugged.",
"required": true,
"location": "path"
},
"id": {
"type": "string",
"description": "Breakpoint identifier, unique in the scope of the debuggee.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"debuggeeId",
"id"
],
"request": {
"$ref": "UpdateActiveBreakpointRequest"
},
"response": {
"$ref": "UpdateActiveBreakpointResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugletcontroller"
]
}
}
}
}
}
}
},
"debugger": {
"resources": {
"debuggees": {
"methods": {
"list": {
"id": "clouddebugger.debugger.debuggees.list",
"path": "v2/debugger/debuggees",
"httpMethod": "GET",
"description": "Lists all the debuggees that the user can set breakpoints to.",
"parameters": {
"project": {
"type": "string",
"description": "Set to the project number of the Google Cloud Platform to list the debuggees that are part of that project.",
"location": "query"
},
"includeInactive": {
"type": "boolean",
"description": "When set to true the result includes all debuggees, otherwise only debugees that are active.",
"location": "query"
}
},
"response": {
"$ref": "ListDebuggeesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugger"
]
}
},
"resources": {
"breakpoints": {
"methods": {
"set": {
"id": "clouddebugger.debugger.debuggees.breakpoints.set",
"path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/set",
"httpMethod": "POST",
"description": "Sets the breakpoint to the debuggee.",
"parameters": {
"debuggeeId": {
"type": "string",
"description": "The debuggee id to set the breakpoint to.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"debuggeeId"
],
"request": {
"$ref": "Breakpoint"
},
"response": {
"$ref": "SetBreakpointResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugger"
]
},
"get": {
"id": "clouddebugger.debugger.debuggees.breakpoints.get",
"path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}",
"httpMethod": "GET",
"description": "Gets breakpoint information.",
"parameters": {
"debuggeeId": {
"type": "string",
"description": "The debuggee id to get the breakpoint from.",
"required": true,
"location": "path"
},
"breakpointId": {
"type": "string",
"description": "The breakpoint to get.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"debuggeeId",
"breakpointId"
],
"response": {
"$ref": "GetBreakpointResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugger"
]
},
"delete": {
"id": "clouddebugger.debugger.debuggees.breakpoints.delete",
"path": "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}",
"httpMethod": "DELETE",
"description": "Deletes the breakpoint from the debuggee.",
"parameters": {
"debuggeeId": {
"type": "string",
"description": "The debuggee id to delete the breakpoint from.",
"required": true,
"location": "path"
},
"breakpointId": {
"type": "string",
"description": "The breakpoint to delete.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"debuggeeId",
"breakpointId"
],
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugger"
]
},
"list": {
"id": "clouddebugger.debugger.debuggees.breakpoints.list",
"path": "v2/debugger/debuggees/{debuggeeId}/breakpoints",
"httpMethod": "GET",
"description": "Lists all breakpoints of the debuggee that the user has access to.",
"parameters": {
"debuggeeId": {
"type": "string",
"description": "The debuggee id to list breakpoint from.",
"required": true,
"location": "path"
},
"includeAllUsers": {
"type": "boolean",
"description": "When set to true the response includes the list of breakpoints set by any user, otherwise only breakpoints set by the caller.",
"location": "query"
},
"includeInactive": {
"type": "boolean",
"description": "When set to true the response includes active and inactive breakpoints, otherwise only active breakpoints are returned.",
"location": "query"
},
"action.value": {
"type": "string",
"description": "Only breakpoints with the specified action will pass the filter.",
"enum": [
"CAPTURE",
"LOG"
],
"location": "query"
},
"stripResults": {
"type": "boolean",
"description": "When set to true the response breakpoints will be stripped of the results fields: stack_frames, evaluated_expressions and variable_table.",
"location": "query"
},
"waitToken": {
"type": "string",
"description": "A wait token that, if specified, blocks the call until the breakpoints list has changed, or a server selected timeout has expired. The value should be set from the last response to ListBreakpoints. The error code ABORTED is returned on wait timeout, which should be called again with the same wait_token.",
"location": "query"
}
},
"parameterOrder": [
"debuggeeId"
],
"response": {
"$ref": "ListBreakpointsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/cloud_debugger"
]
}
}
}
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,212 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/qJOZypus2JZqrrIOB0BaiZ76VFY\"",
"discoveryVersion": "v1",
"id": "cloudlatencytest:v2",
"name": "cloudlatencytest",
"version": "v2",
"revision": "20150206",
"title": "Google Cloud Network Performance Monitoring API",
"description": "A Test API to report latency data.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "",
"protocol": "rest",
"baseUrl": "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/",
"basePath": "/v2/statscollection/",
"rootUrl": "https://cloudlatencytest-pa.googleapis.com/",
"servicePath": "v2/statscollection/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/monitoring.readonly": {
"description": "View monitoring data for all of your Google Cloud and API projects"
}
}
}
},
"schemas": {
"AggregatedStats": {
"id": "AggregatedStats",
"type": "object",
"properties": {
"stats": {
"type": "array",
"items": {
"$ref": "Stats"
}
}
}
},
"AggregatedStatsReply": {
"id": "AggregatedStatsReply",
"type": "object",
"properties": {
"testValue": {
"type": "string"
}
}
},
"DoubleValue": {
"id": "DoubleValue",
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "number",
"format": "float"
}
}
},
"IntValue": {
"id": "IntValue",
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "string",
"format": "int64"
}
}
},
"Stats": {
"id": "Stats",
"type": "object",
"properties": {
"doubleValues": {
"type": "array",
"items": {
"$ref": "DoubleValue"
}
},
"intValues": {
"type": "array",
"items": {
"$ref": "IntValue"
}
},
"stringValues": {
"type": "array",
"items": {
"$ref": "StringValue"
}
},
"time": {
"type": "number",
"format": "double"
}
}
},
"StatsReply": {
"id": "StatsReply",
"type": "object",
"properties": {
"testValue": {
"type": "string"
}
}
},
"StringValue": {
"id": "StringValue",
"type": "object",
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
},
"resources": {
"statscollection": {
"methods": {
"updateaggregatedstats": {
"id": "cloudlatencytest.statscollection.updateaggregatedstats",
"path": "updateaggregatedstats",
"httpMethod": "POST",
"description": "RPC to update the new TCP stats.",
"request": {
"$ref": "AggregatedStats"
},
"response": {
"$ref": "AggregatedStatsReply"
},
"scopes": [
"https://www.googleapis.com/auth/monitoring.readonly"
]
},
"updatestats": {
"id": "cloudlatencytest.statscollection.updatestats",
"path": "updatestats",
"httpMethod": "POST",
"description": "RPC to update the new TCP stats.",
"request": {
"$ref": "Stats"
},
"response": {
"$ref": "StatsReply"
},
"scopes": [
"https://www.googleapis.com/auth/monitoring.readonly"
]
}
}
}
}
}

View file

@ -1,447 +0,0 @@
// Package cloudlatencytest provides access to the Google Cloud Network Performance Monitoring API.
//
// Usage example:
//
// import "google.golang.org/api/cloudlatencytest/v2"
// ...
// cloudlatencytestService, err := cloudlatencytest.New(oauthHttpClient)
package cloudlatencytest // import "google.golang.org/api/cloudlatencytest/v2"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "cloudlatencytest:v2"
const apiName = "cloudlatencytest"
const apiVersion = "v2"
const basePath = "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/"
// OAuth2 scopes used by this API.
const (
// View monitoring data for all of your Google Cloud and API projects
MonitoringReadonlyScope = "https://www.googleapis.com/auth/monitoring.readonly"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Statscollection = NewStatscollectionService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Statscollection *StatscollectionService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewStatscollectionService(s *Service) *StatscollectionService {
rs := &StatscollectionService{s: s}
return rs
}
type StatscollectionService struct {
s *Service
}
type AggregatedStats struct {
Stats []*Stats `json:"stats,omitempty"`
// ForceSendFields is a list of field names (e.g. "Stats") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AggregatedStats) MarshalJSON() ([]byte, error) {
type noMethod AggregatedStats
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type AggregatedStatsReply struct {
TestValue string `json:"testValue,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "TestValue") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AggregatedStatsReply) MarshalJSON() ([]byte, error) {
type noMethod AggregatedStatsReply
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type DoubleValue struct {
Label string `json:"label,omitempty"`
Value float64 `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Label") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *DoubleValue) MarshalJSON() ([]byte, error) {
type noMethod DoubleValue
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type IntValue struct {
Label string `json:"label,omitempty"`
Value int64 `json:"value,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "Label") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *IntValue) MarshalJSON() ([]byte, error) {
type noMethod IntValue
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type Stats struct {
DoubleValues []*DoubleValue `json:"doubleValues,omitempty"`
IntValues []*IntValue `json:"intValues,omitempty"`
StringValues []*StringValue `json:"stringValues,omitempty"`
Time float64 `json:"time,omitempty"`
// ForceSendFields is a list of field names (e.g. "DoubleValues") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Stats) MarshalJSON() ([]byte, error) {
type noMethod Stats
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type StatsReply struct {
TestValue string `json:"testValue,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "TestValue") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *StatsReply) MarshalJSON() ([]byte, error) {
type noMethod StatsReply
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type StringValue struct {
Label string `json:"label,omitempty"`
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Label") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *StringValue) MarshalJSON() ([]byte, error) {
type noMethod StringValue
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "cloudlatencytest.statscollection.updateaggregatedstats":
type StatscollectionUpdateaggregatedstatsCall struct {
s *Service
aggregatedstats *AggregatedStats
opt_ map[string]interface{}
ctx_ context.Context
}
// Updateaggregatedstats: RPC to update the new TCP stats.
func (r *StatscollectionService) Updateaggregatedstats(aggregatedstats *AggregatedStats) *StatscollectionUpdateaggregatedstatsCall {
c := &StatscollectionUpdateaggregatedstatsCall{s: r.s, opt_: make(map[string]interface{})}
c.aggregatedstats = aggregatedstats
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatscollectionUpdateaggregatedstatsCall) Fields(s ...googleapi.Field) *StatscollectionUpdateaggregatedstatsCall {
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.
func (c *StatscollectionUpdateaggregatedstatsCall) Context(ctx context.Context) *StatscollectionUpdateaggregatedstatsCall {
c.ctx_ = ctx
return c
}
func (c *StatscollectionUpdateaggregatedstatsCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.aggregatedstats)
if err != nil {
return nil, err
}
ctype := "application/json"
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, "updateaggregatedstats")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudlatencytest.statscollection.updateaggregatedstats" call.
// Exactly one of *AggregatedStatsReply or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *AggregatedStatsReply.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 *StatscollectionUpdateaggregatedstatsCall) Do() (*AggregatedStatsReply, 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 := &AggregatedStatsReply{
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": "RPC to update the new TCP stats.",
// "httpMethod": "POST",
// "id": "cloudlatencytest.statscollection.updateaggregatedstats",
// "path": "updateaggregatedstats",
// "request": {
// "$ref": "AggregatedStats"
// },
// "response": {
// "$ref": "AggregatedStatsReply"
// },
// "scopes": [
// "https://www.googleapis.com/auth/monitoring.readonly"
// ]
// }
}
// method id "cloudlatencytest.statscollection.updatestats":
type StatscollectionUpdatestatsCall struct {
s *Service
stats *Stats
opt_ map[string]interface{}
ctx_ context.Context
}
// Updatestats: RPC to update the new TCP stats.
func (r *StatscollectionService) Updatestats(stats *Stats) *StatscollectionUpdatestatsCall {
c := &StatscollectionUpdatestatsCall{s: r.s, opt_: make(map[string]interface{})}
c.stats = stats
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *StatscollectionUpdatestatsCall) Fields(s ...googleapi.Field) *StatscollectionUpdatestatsCall {
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.
func (c *StatscollectionUpdatestatsCall) Context(ctx context.Context) *StatscollectionUpdatestatsCall {
c.ctx_ = ctx
return c
}
func (c *StatscollectionUpdatestatsCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.stats)
if err != nil {
return nil, err
}
ctype := "application/json"
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, "updatestats")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudlatencytest.statscollection.updatestats" call.
// Exactly one of *StatsReply or error will be non-nil. Any non-2xx
// status code is an error. Response headers are in either
// *StatsReply.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 *StatscollectionUpdatestatsCall) Do() (*StatsReply, 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 := &StatsReply{
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": "RPC to update the new TCP stats.",
// "httpMethod": "POST",
// "id": "cloudlatencytest.statscollection.updatestats",
// "path": "updatestats",
// "request": {
// "$ref": "Stats"
// },
// "response": {
// "$ref": "StatsReply"
// },
// "scopes": [
// "https://www.googleapis.com/auth/monitoring.readonly"
// ]
// }
}

View file

@ -1,839 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/avMl03W4ktR_Q7PS4O3ogtyT8Dc\"",
"discoveryVersion": "v1",
"id": "cloudmonitoring:v2beta2",
"name": "cloudmonitoring",
"canonicalName": "Cloud Monitoring",
"version": "v2beta2",
"revision": "20150713",
"title": "Cloud Monitoring API",
"description": "API for accessing Google Cloud and API monitoring data.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/monitoring/v2beta2/",
"protocol": "rest",
"baseUrl": "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/",
"basePath": "/cloudmonitoring/v2beta2/projects/",
"rootUrl": "https://www.googleapis.com/",
"servicePath": "cloudmonitoring/v2beta2/projects/",
"batchPath": "batch",
"parameters": {
"alt": {
"type": "string",
"description": "Data format for the response.",
"default": "json",
"enum": [
"json"
],
"enumDescriptions": [
"Responses with Content-Type of application/json"
],
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"location": "query"
},
"userIp": {
"type": "string",
"description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.",
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
},
"https://www.googleapis.com/auth/monitoring": {
"description": "View and write monitoring data for all of your Google and third-party Cloud and API projects"
}
}
}
},
"schemas": {
"DeleteMetricDescriptorResponse": {
"id": "DeleteMetricDescriptorResponse",
"type": "object",
"description": "The response of cloudmonitoring.metricDescriptors.delete.",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#deleteMetricDescriptorResponse\".",
"default": "cloudmonitoring#deleteMetricDescriptorResponse"
}
}
},
"ListMetricDescriptorsRequest": {
"id": "ListMetricDescriptorsRequest",
"type": "object",
"description": "The request of cloudmonitoring.metricDescriptors.list.",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listMetricDescriptorsRequest\".",
"default": "cloudmonitoring#listMetricDescriptorsRequest"
}
}
},
"ListMetricDescriptorsResponse": {
"id": "ListMetricDescriptorsResponse",
"type": "object",
"description": "The response of cloudmonitoring.metricDescriptors.list.",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listMetricDescriptorsResponse\".",
"default": "cloudmonitoring#listMetricDescriptorsResponse"
},
"metrics": {
"type": "array",
"description": "The returned metric descriptors.",
"items": {
"$ref": "MetricDescriptor"
}
},
"nextPageToken": {
"type": "string",
"description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, pass this value to the pageToken query parameter."
}
}
},
"ListTimeseriesDescriptorsRequest": {
"id": "ListTimeseriesDescriptorsRequest",
"type": "object",
"description": "The request of cloudmonitoring.timeseriesDescriptors.list",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesDescriptorsRequest\".",
"default": "cloudmonitoring#listTimeseriesDescriptorsRequest"
}
}
},
"ListTimeseriesDescriptorsResponse": {
"id": "ListTimeseriesDescriptorsResponse",
"type": "object",
"description": "The response of cloudmonitoring.timeseriesDescriptors.list",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesDescriptorsResponse\".",
"default": "cloudmonitoring#listTimeseriesDescriptorsResponse"
},
"nextPageToken": {
"type": "string",
"description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this value to the pageToken query parameter."
},
"oldest": {
"type": "string",
"description": "The oldest timestamp of the interval of this query, as an RFC 3339 string.",
"format": "date-time"
},
"timeseries": {
"type": "array",
"description": "The returned time series descriptors.",
"items": {
"$ref": "TimeseriesDescriptor"
}
},
"youngest": {
"type": "string",
"description": "The youngest timestamp of the interval of this query, as an RFC 3339 string.",
"format": "date-time"
}
}
},
"ListTimeseriesRequest": {
"id": "ListTimeseriesRequest",
"type": "object",
"description": "The request of cloudmonitoring.timeseries.list",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesRequest\".",
"default": "cloudmonitoring#listTimeseriesRequest"
}
}
},
"ListTimeseriesResponse": {
"id": "ListTimeseriesResponse",
"type": "object",
"description": "The response of cloudmonitoring.timeseries.list",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#listTimeseriesResponse\".",
"default": "cloudmonitoring#listTimeseriesResponse"
},
"nextPageToken": {
"type": "string",
"description": "Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series."
},
"oldest": {
"type": "string",
"description": "The oldest timestamp of the interval of this query as an RFC 3339 string.",
"format": "date-time"
},
"timeseries": {
"type": "array",
"description": "The returned time series.",
"items": {
"$ref": "Timeseries"
}
},
"youngest": {
"type": "string",
"description": "The youngest timestamp of the interval of this query as an RFC 3339 string.",
"format": "date-time"
}
}
},
"MetricDescriptor": {
"id": "MetricDescriptor",
"type": "object",
"description": "A metricDescriptor defines the name, label keys, and data type of a particular metric.",
"properties": {
"description": {
"type": "string",
"description": "Description of this metric."
},
"labels": {
"type": "array",
"description": "Labels defined for this metric.",
"items": {
"$ref": "MetricDescriptorLabelDescriptor"
}
},
"name": {
"type": "string",
"description": "The name of this metric."
},
"project": {
"type": "string",
"description": "The project ID to which the metric belongs."
},
"typeDescriptor": {
"$ref": "MetricDescriptorTypeDescriptor",
"description": "Type description for this metric."
}
}
},
"MetricDescriptorLabelDescriptor": {
"id": "MetricDescriptorLabelDescriptor",
"type": "object",
"description": "A label in a metric is a description of this metric, including the key of this description (what the description is), and the value for this description.",
"properties": {
"description": {
"type": "string",
"description": "Label description."
},
"key": {
"type": "string",
"description": "Label key."
}
}
},
"MetricDescriptorTypeDescriptor": {
"id": "MetricDescriptorTypeDescriptor",
"type": "object",
"description": "A type in a metric contains information about how the metric is collected and what its data points look like.",
"properties": {
"metricType": {
"type": "string",
"description": "The method of collecting data for the metric. See Metric types."
},
"valueType": {
"type": "string",
"description": "The data type of of individual points in the metric's time series. See Metric value types."
}
}
},
"Point": {
"id": "Point",
"type": "object",
"description": "Point is a single point in a time series. It consists of a start time, an end time, and a value.",
"properties": {
"boolValue": {
"type": "boolean",
"description": "The value of this data point. Either \"true\" or \"false\"."
},
"distributionValue": {
"$ref": "PointDistribution",
"description": "The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The values of these points can be used to create a histogram."
},
"doubleValue": {
"type": "number",
"description": "The value of this data point as a double-precision floating-point number.",
"format": "double"
},
"end": {
"type": "string",
"description": "The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.",
"format": "date-time"
},
"int64Value": {
"type": "string",
"description": "The value of this data point as a 64-bit integer.",
"format": "int64"
},
"start": {
"type": "string",
"description": "The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.",
"format": "date-time"
},
"stringValue": {
"type": "string",
"description": "The value of this data point in string format."
}
}
},
"PointDistribution": {
"id": "PointDistribution",
"type": "object",
"description": "Distribution data point value type. When writing distribution points, try to be consistent with the boundaries of your buckets. If you must modify the bucket boundaries, then do so by merging, partitioning, or appending rather than skewing them.",
"properties": {
"buckets": {
"type": "array",
"description": "The finite buckets.",
"items": {
"$ref": "PointDistributionBucket"
}
},
"overflowBucket": {
"$ref": "PointDistributionOverflowBucket",
"description": "The overflow bucket."
},
"underflowBucket": {
"$ref": "PointDistributionUnderflowBucket",
"description": "The underflow bucket."
}
}
},
"PointDistributionBucket": {
"id": "PointDistributionBucket",
"type": "object",
"description": "The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event in [U1, L2).",
"properties": {
"count": {
"type": "string",
"description": "The number of events whose values are in the interval defined by this bucket.",
"format": "int64"
},
"lowerBound": {
"type": "number",
"description": "The lower bound of the value interval of this bucket (inclusive).",
"format": "double"
},
"upperBound": {
"type": "number",
"description": "The upper bound of the value interval of this bucket (exclusive).",
"format": "double"
}
}
},
"PointDistributionOverflowBucket": {
"id": "PointDistributionOverflowBucket",
"type": "object",
"description": "The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the events that are no less than its lower bound.",
"properties": {
"count": {
"type": "string",
"description": "The number of events whose values are in the interval defined by this bucket.",
"format": "int64"
},
"lowerBound": {
"type": "number",
"description": "The lower bound of the value interval of this bucket (inclusive).",
"format": "double"
}
}
},
"PointDistributionUnderflowBucket": {
"id": "PointDistributionUnderflowBucket",
"type": "object",
"description": "The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of the events that are less than its upper bound.",
"properties": {
"count": {
"type": "string",
"description": "The number of events whose values are in the interval defined by this bucket.",
"format": "int64"
},
"upperBound": {
"type": "number",
"description": "The upper bound of the value interval of this bucket (exclusive).",
"format": "double"
}
}
},
"Timeseries": {
"id": "Timeseries",
"type": "object",
"description": "The monitoring data is organized as metrics and stored as data points that are recorded over time. Each data point represents information like the CPU utilization of your virtual machine. A historical record of these data points is called a time series.",
"properties": {
"points": {
"type": "array",
"description": "The data points of this time series. The points are listed in order of their end timestamp, from younger to older.",
"items": {
"$ref": "Point"
}
},
"timeseriesDesc": {
"$ref": "TimeseriesDescriptor",
"description": "The descriptor of this time series."
}
}
},
"TimeseriesDescriptor": {
"id": "TimeseriesDescriptor",
"type": "object",
"description": "TimeseriesDescriptor identifies a single time series.",
"properties": {
"labels": {
"type": "object",
"description": "The label's name.",
"additionalProperties": {
"type": "string",
"description": "The label's name."
}
},
"metric": {
"type": "string",
"description": "The name of the metric."
},
"project": {
"type": "string",
"description": "The Developers Console project number to which this time series belongs."
}
}
},
"TimeseriesDescriptorLabel": {
"id": "TimeseriesDescriptorLabel",
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "The label's name."
},
"value": {
"type": "string",
"description": "The label's value."
}
}
},
"TimeseriesPoint": {
"id": "TimeseriesPoint",
"type": "object",
"description": "When writing time series, TimeseriesPoint should be used instead of Timeseries, to enforce single point for each time series in the timeseries.write request.",
"properties": {
"point": {
"$ref": "Point",
"description": "The data point in this time series snapshot."
},
"timeseriesDesc": {
"$ref": "TimeseriesDescriptor",
"description": "The descriptor of this time series."
}
}
},
"WriteTimeseriesRequest": {
"id": "WriteTimeseriesRequest",
"type": "object",
"description": "The request of cloudmonitoring.timeseries.write",
"properties": {
"commonLabels": {
"type": "object",
"description": "The label's name.",
"additionalProperties": {
"type": "string",
"description": "The label's name."
}
},
"timeseries": {
"type": "array",
"description": "Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete list of labels that required by the metric.",
"items": {
"$ref": "TimeseriesPoint"
}
}
}
},
"WriteTimeseriesResponse": {
"id": "WriteTimeseriesResponse",
"type": "object",
"description": "The response of cloudmonitoring.timeseries.write",
"properties": {
"kind": {
"type": "string",
"description": "Identifies what kind of resource this is. Value: the fixed string \"cloudmonitoring#writeTimeseriesResponse\".",
"default": "cloudmonitoring#writeTimeseriesResponse"
}
}
}
},
"resources": {
"metricDescriptors": {
"methods": {
"create": {
"id": "cloudmonitoring.metricDescriptors.create",
"path": "{project}/metricDescriptors",
"httpMethod": "POST",
"description": "Create a new metric.",
"parameters": {
"project": {
"type": "string",
"description": "The project id. The value can be the numeric project ID or string-based project name.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project"
],
"request": {
"$ref": "MetricDescriptor"
},
"response": {
"$ref": "MetricDescriptor"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"
]
},
"delete": {
"id": "cloudmonitoring.metricDescriptors.delete",
"path": "{project}/metricDescriptors/{metric}",
"httpMethod": "DELETE",
"description": "Delete an existing metric.",
"parameters": {
"metric": {
"type": "string",
"description": "Name of the metric.",
"required": true,
"location": "path"
},
"project": {
"type": "string",
"description": "The project ID to which the metric belongs.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project",
"metric"
],
"response": {
"$ref": "DeleteMetricDescriptorResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"
]
},
"list": {
"id": "cloudmonitoring.metricDescriptors.list",
"path": "{project}/metricDescriptors",
"httpMethod": "GET",
"description": "List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.",
"parameters": {
"count": {
"type": "integer",
"description": "Maximum number of metric descriptors per page. Used for pagination. If not specified, count = 100.",
"default": "100",
"format": "int32",
"minimum": "1",
"maximum": "1000",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.",
"location": "query"
},
"project": {
"type": "string",
"description": "The project id. The value can be the numeric project ID or string-based project name.",
"required": true,
"location": "path"
},
"query": {
"type": "string",
"description": "The query used to search against existing metrics. Separate keywords with a space; the service joins all keywords with AND, meaning that all keywords must match for a metric to be returned. If this field is omitted, all metrics are returned. If an empty string is passed with this field, no metrics are returned.",
"location": "query"
}
},
"parameterOrder": [
"project"
],
"request": {
"$ref": "ListMetricDescriptorsRequest"
},
"response": {
"$ref": "ListMetricDescriptorsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"
]
}
}
},
"timeseries": {
"methods": {
"list": {
"id": "cloudmonitoring.timeseries.list",
"path": "{project}/timeseries/{metric}",
"httpMethod": "GET",
"description": "List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.",
"parameters": {
"aggregator": {
"type": "string",
"description": "The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.",
"enum": [
"max",
"mean",
"min",
"sum"
],
"enumDescriptions": [
"",
"",
"",
""
],
"location": "query"
},
"count": {
"type": "integer",
"description": "Maximum number of data points per page, which is used for pagination of results.",
"default": "6000",
"format": "int32",
"minimum": "1",
"maximum": "12000",
"location": "query"
},
"labels": {
"type": "string",
"description": "A collection of labels for the matching time series, which are represented as: \n- key==value: key equals the value \n- key=~value: key regex matches the value \n- key!=value: key does not equal the value \n- key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify:\nlabel=cloud.googleapis.com%2Flocation=~us-central1.*",
"pattern": "(.+?)(==|=~|!=|!~)(.+)",
"repeated": true,
"location": "query"
},
"metric": {
"type": "string",
"description": "Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.",
"required": true,
"location": "path"
},
"oldest": {
"type": "string",
"description": "Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.",
"location": "query"
},
"project": {
"type": "string",
"description": "The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.",
"required": true,
"location": "path"
},
"timespan": {
"type": "string",
"description": "Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: \n- s: second \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.\n\nIf neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest].",
"pattern": "[0-9]+[smhdw]?",
"location": "query"
},
"window": {
"type": "string",
"description": "The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.",
"pattern": "[0-9]+[mhdw]?",
"location": "query"
},
"youngest": {
"type": "string",
"description": "End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.",
"required": true,
"location": "query"
}
},
"parameterOrder": [
"project",
"metric",
"youngest"
],
"request": {
"$ref": "ListTimeseriesRequest"
},
"response": {
"$ref": "ListTimeseriesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"
]
},
"write": {
"id": "cloudmonitoring.timeseries.write",
"path": "{project}/timeseries:write",
"httpMethod": "POST",
"description": "Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.",
"parameters": {
"project": {
"type": "string",
"description": "The project ID. The value can be the numeric project ID or string-based project name.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"project"
],
"request": {
"$ref": "WriteTimeseriesRequest"
},
"response": {
"$ref": "WriteTimeseriesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"
]
}
}
},
"timeseriesDescriptors": {
"methods": {
"list": {
"id": "cloudmonitoring.timeseriesDescriptors.list",
"path": "{project}/timeseriesDescriptors/{metric}",
"httpMethod": "GET",
"description": "List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.",
"parameters": {
"aggregator": {
"type": "string",
"description": "The aggregation function that will reduce the data points in each window to a single point. This parameter is only valid for non-cumulative metrics with a value type of INT64 or DOUBLE.",
"enum": [
"max",
"mean",
"min",
"sum"
],
"enumDescriptions": [
"",
"",
"",
""
],
"location": "query"
},
"count": {
"type": "integer",
"description": "Maximum number of time series descriptors per page. Used for pagination. If not specified, count = 100.",
"default": "100",
"format": "int32",
"minimum": "1",
"maximum": "1000",
"location": "query"
},
"labels": {
"type": "string",
"description": "A collection of labels for the matching time series, which are represented as: \n- key==value: key equals the value \n- key=~value: key regex matches the value \n- key!=value: key does not equal the value \n- key!~value: key regex does not match the value For example, to list all of the time series descriptors for the region us-central1, you could specify:\nlabel=cloud.googleapis.com%2Flocation=~us-central1.*",
"pattern": "(.+?)(==|=~|!=|!~)(.+)",
"repeated": true,
"location": "query"
},
"metric": {
"type": "string",
"description": "Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.",
"required": true,
"location": "path"
},
"oldest": {
"type": "string",
"description": "Start of the time interval (exclusive), which is expressed as an RFC 3339 timestamp. If neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest]",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "The pagination token, which is used to page through large result sets. Set this value to the value of the nextPageToken to retrieve the next page of results.",
"location": "query"
},
"project": {
"type": "string",
"description": "The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.",
"required": true,
"location": "path"
},
"timespan": {
"type": "string",
"description": "Length of the time interval to query, which is an alternative way to declare the interval: (youngest - timespan, youngest]. The timespan and oldest parameters should not be used together. Units: \n- s: second \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 2s, 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.\n\nIf neither oldest nor timespan is specified, the default time interval will be (youngest - 4 hours, youngest].",
"pattern": "[0-9]+[smhdw]?",
"location": "query"
},
"window": {
"type": "string",
"description": "The sampling window. At most one data point will be returned for each window in the requested time interval. This parameter is only valid for non-cumulative metric types. Units: \n- m: minute \n- h: hour \n- d: day \n- w: week Examples: 3m, 4w. Only one unit is allowed, for example: 2w3d is not allowed; you should use 17d instead.",
"pattern": "[0-9]+[mhdw]?",
"location": "query"
},
"youngest": {
"type": "string",
"description": "End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.",
"required": true,
"location": "query"
}
},
"parameterOrder": [
"project",
"metric",
"youngest"
],
"request": {
"$ref": "ListTimeseriesDescriptorsRequest"
},
"response": {
"$ref": "ListTimeseriesDescriptorsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/monitoring"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,716 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/YIS10F0R5FiTmx2jJKQHlRv-GwY\"",
"discoveryVersion": "v1",
"id": "cloudresourcemanager:v1beta1",
"name": "cloudresourcemanager",
"version": "v1beta1",
"revision": "20150909",
"title": "Google Cloud Resource Manager API",
"description": "The Google Cloud Resource Manager API provides methods for creating, reading, and updating of project metadata.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/resource-manager",
"protocol": "rest",
"baseUrl": "https://cloudresourcemanager.googleapis.com/",
"basePath": "/",
"rootUrl": "https://cloudresourcemanager.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
}
}
}
},
"schemas": {
"Project": {
"id": "Project",
"type": "object",
"description": "A Project is a high-level Google Cloud Platform entity. It is a container for ACLs, APIs, AppEngine Apps, VMs, and other Google Cloud Platform resources.",
"properties": {
"projectNumber": {
"type": "string",
"description": "The number uniquely identifying the project. Example: 415104041262 Read-only.",
"format": "int64"
},
"projectId": {
"type": "string",
"description": "The unique, user-assigned ID of the project. It must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. Example: tokyo-rain-123 Read-only after creation."
},
"lifecycleState": {
"type": "string",
"description": "The project lifecycle state. Read-only.",
"enum": [
"LIFECYCLE_STATE_UNSPECIFIED",
"ACTIVE",
"DELETE_REQUESTED",
"DELETE_IN_PROGRESS"
]
},
"name": {
"type": "string",
"description": "The user-assigned name of the project. It must be 4 to 30 characters. Allowed characters are: lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point. Example: My Project Read-write."
},
"createTime": {
"type": "string",
"description": "Creation time. Read-only."
},
"labels": {
"type": "object",
"description": "The labels associated with this project. Label keys must be between 1 and 63 characters long and must conform to the following regular expression: \\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?. Label values must be between 0 and 63 characters long and must conform to the regular expression (\\[a-z\\](\\[-a-z0-9\\]*\\[a-z0-9\\])?)?. No more than 256 labels can be associated with a given resource. Clients should store labels in a representation such as JSON that does not depend on specific characters being disallowed. Example: \"environment\" : \"dev\" Read-write.",
"additionalProperties": {
"type": "string"
}
},
"parent": {
"$ref": "ResourceId",
"description": "An optional reference to a parent Resource. The only supported parent type is \"organization\". Once set, the parent cannot be modified. Read-write."
}
}
},
"ResourceId": {
"id": "ResourceId",
"type": "object",
"description": "A container to reference an id for any resource type. A 'resource' in Google Cloud Platform is a generic term for something you (a developer) may want to interact with through one of our API's. Some examples are an AppEngine app, a Compute Engine instance, Cloud SQL database, ...",
"properties": {
"type": {
"type": "string",
"description": "Required field representing the resource type this id is for. At present, the only valid type is \"organization\"."
},
"id": {
"type": "string",
"description": "Required field for the type-specific id. This should correspond to the id used in the type-specific API's."
}
}
},
"ListProjectsResponse": {
"id": "ListProjectsResponse",
"type": "object",
"description": "A page of the response received from the [ListProjects][google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] method. A paginated response where more pages are available has `next_page_token` set. This token can be used in a subsequent request to retrieve the next request page.",
"properties": {
"projects": {
"type": "array",
"description": "The list of projects that matched the list filter. This list can be paginated.",
"items": {
"$ref": "Project"
}
},
"nextPageToken": {
"type": "string",
"description": "Pagination token. If the result set is too large to fit in a single response, this token is returned. It encodes the position of the current result cursor. Feeding this value into a new list request with the `page_token` parameter gives the next page of the results. When `next_page_token` is not filled in, there is no next page and the list returned is the last page in the result set. Pagination tokens have a limited lifetime. Note: pagination is not yet supported; the server will not set this field."
}
}
},
"Empty": {
"id": "Empty",
"type": "object",
"description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`."
},
"GetIamPolicyRequest": {
"id": "GetIamPolicyRequest",
"type": "object",
"description": "Request message for `GetIamPolicy` method."
},
"Policy": {
"id": "Policy",
"type": "object",
"description": "Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. **Example** ``` { \"bindings\": [ { \"role\": \"roles/owner\", \"members\": [ \"user:mike@example.com\", \"group:admins@example.com\", \"domain:google.com\", \"serviceAccount:my-other-app@appspot.gserviceaccount.com\"] }, { \"role\": \"roles/viewer\", \"members\": [\"user:sean@example.com\"] } ] } ``` For a description of IAM and its features, see the [IAM developer's guide][https://cloud.google.com/iam].",
"properties": {
"version": {
"type": "integer",
"description": "Version of the `Policy`. The default version is 0.",
"format": "int32"
},
"bindings": {
"type": "array",
"description": "Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error.",
"items": {
"$ref": "Binding"
}
},
"etag": {
"type": "string",
"description": "Can be used to perform a read-modify-write.",
"format": "byte"
}
}
},
"Binding": {
"id": "Binding",
"type": "object",
"description": "Associates `members` with a `role`.",
"properties": {
"role": {
"type": "string",
"description": "Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required"
},
"members": {
"type": "array",
"description": "Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following formats: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`.",
"items": {
"type": "string"
}
}
}
},
"SetIamPolicyRequest": {
"id": "SetIamPolicyRequest",
"type": "object",
"description": "Request message for `SetIamPolicy` method.",
"properties": {
"policy": {
"$ref": "Policy",
"description": "REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them."
}
}
},
"TestIamPermissionsRequest": {
"id": "TestIamPermissionsRequest",
"type": "object",
"description": "Request message for `TestIamPermissions` method.",
"properties": {
"permissions": {
"type": "array",
"description": "The set of permissions to check for the `resource`. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.",
"items": {
"type": "string"
}
}
}
},
"TestIamPermissionsResponse": {
"id": "TestIamPermissionsResponse",
"type": "object",
"description": "Response message for `TestIamPermissions` method.",
"properties": {
"permissions": {
"type": "array",
"description": "A subset of `TestPermissionsRequest.permissions` that the caller is allowed.",
"items": {
"type": "string"
}
}
}
},
"ListOrganizationsResponse": {
"id": "ListOrganizationsResponse",
"type": "object",
"description": "The response returned from the ListOrganizations method.",
"properties": {
"organizations": {
"type": "array",
"description": "The list of Organizations that matched the list query, possibly paginated.",
"items": {
"$ref": "Organization"
}
},
"nextPageToken": {
"type": "string",
"description": "A pagination token to be used to retrieve the next page of results. If the result is too large to fit within the page size specified in the request, this field will be set with a token that can be used to fetch the next page of results. If this field is empty, it indicates that this response contains the last page of results."
}
}
},
"Organization": {
"id": "Organization",
"type": "object",
"description": "The root node in the resource hierarchy to which a particular entity's (e.g., company) resources belong.",
"properties": {
"organizationId": {
"type": "string",
"description": "An immutable id for the Organization that is assigned on creation. This should be omitted when creating a new Organization. This field is read-only."
},
"displayName": {
"type": "string",
"description": "A friendly string to be used to refer to the Organization in the UI. This field is required."
},
"owner": {
"$ref": "OrganizationOwner",
"description": "The owner of this Organization. The owner should be specified upon creation. Once set, it cannot be changed. This field is required."
}
}
},
"OrganizationOwner": {
"id": "OrganizationOwner",
"type": "object",
"description": "The entity that owns an Organization. The lifetime of the Organization and all of its descendants are bound to the OrganizationOwner. If the OrganizationOwner is deleted, the Organization and all its descendants will be deleted.",
"properties": {
"directoryCustomerId": {
"type": "string",
"description": "The Google for Work customer id used in the Directory API."
}
}
}
},
"resources": {
"projects": {
"methods": {
"create": {
"id": "cloudresourcemanager.projects.create",
"path": "v1beta1/projects",
"httpMethod": "POST",
"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.",
"request": {
"$ref": "Project"
},
"response": {
"$ref": "Project"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"list": {
"id": "cloudresourcemanager.projects.list",
"path": "v1beta1/projects",
"httpMethod": "GET",
"description": "Lists projects that are visible to the user and satisfy the specified filter. This method returns projects in an unspecified order. New projects do not necessarily appear at the end of the list.",
"parameters": {
"pageToken": {
"type": "string",
"description": "A pagination token returned from a previous call to ListProject that indicates from where listing should continue. Note: pagination is not yet supported; the server ignores this field. Optional.",
"location": "query"
},
"pageSize": {
"type": "integer",
"description": "The maximum number of Projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default. Note: pagination is not yet supported; the server ignores this field. Optional.",
"format": "int32",
"location": "query"
},
"filter": {
"type": "string",
"description": "An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:*|The project has a name.| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red label.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. Optional.",
"location": "query"
}
},
"response": {
"$ref": "ListProjectsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"get": {
"id": "cloudresourcemanager.projects.get",
"path": "v1beta1/projects/{projectId}",
"httpMethod": "GET",
"description": "Retrieves the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this project.",
"parameters": {
"projectId": {
"type": "string",
"description": "The project ID (for example, `my-project-123`). Required.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId"
],
"response": {
"$ref": "Project"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"update": {
"id": "cloudresourcemanager.projects.update",
"path": "v1beta1/projects/{projectId}",
"httpMethod": "PUT",
"description": "Updates the attributes of the project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this project.",
"parameters": {
"projectId": {
"type": "string",
"description": "The project ID (for example, `my-project-123`). Required.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId"
],
"request": {
"$ref": "Project"
},
"response": {
"$ref": "Project"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"delete": {
"id": "cloudresourcemanager.projects.delete",
"path": "v1beta1/projects/{projectId}",
"httpMethod": "DELETE",
"description": "Marks the project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the project if the following criteria are met: + The project does not have a billing account associated with it. + The project has a lifecycle state of [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE]. This method changes the project's lifecycle state from [ACTIVE][google.cloudresourcemanager.projects.v1beta1.LifecycleState.ACTIVE] to [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. The deletion starts at an unspecified time, at which point the lifecycle state changes to [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS]. Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject], and the project remains visible to [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects]. However, you cannot update the project. After the deletion completes, the project is not retrievable by the [GetProject] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetProject] and [ListProjects] [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.ListProjects] methods. The caller must have modify permissions for this project.",
"parameters": {
"projectId": {
"type": "string",
"description": "The project ID (for example, `foo-bar-123`). Required.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId"
],
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"undelete": {
"id": "cloudresourcemanager.projects.undelete",
"path": "v1beta1/projects/{projectId}:undelete",
"httpMethod": "POST",
"description": "Restores the project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_REQUESTED]. After deletion starts, as indicated by a lifecycle state of [DELETE_IN_PROGRESS] [google.cloudresourcemanager.projects.v1beta1.LifecycleState.DELETE_IN_PROGRESS], the project cannot be restored. The caller must have modify permissions for this project.",
"parameters": {
"projectId": {
"type": "string",
"description": "The project ID (for example, `foo-bar-123`). Required.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId"
],
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"getIamPolicy": {
"id": "cloudresourcemanager.projects.getIamPolicy",
"path": "v1beta1/projects/{resource}:getIamPolicy",
"httpMethod": "POST",
"description": "Returns the IAM access control policy for specified project.",
"parameters": {
"resource": {
"type": "string",
"description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"resource"
],
"request": {
"$ref": "GetIamPolicyRequest"
},
"response": {
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"setIamPolicy": {
"id": "cloudresourcemanager.projects.setIamPolicy",
"path": "v1beta1/projects/{resource}:setIamPolicy",
"httpMethod": "POST",
"description": "Sets the IAM access control policy for the specified project. We do not currently support 'domain:' prefixed members in a Binding of a Policy. Calling this method requires enabling the App Engine Admin API.",
"parameters": {
"resource": {
"type": "string",
"description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"resource"
],
"request": {
"$ref": "SetIamPolicyRequest"
},
"response": {
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"testIamPermissions": {
"id": "cloudresourcemanager.projects.testIamPermissions",
"path": "v1beta1/projects/{resource}:testIamPermissions",
"httpMethod": "POST",
"description": "Tests the specified permissions against the IAM access control policy for the specified project.",
"parameters": {
"resource": {
"type": "string",
"description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"resource"
],
"request": {
"$ref": "TestIamPermissionsRequest"
},
"response": {
"$ref": "TestIamPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
},
"organizations": {
"methods": {
"list": {
"id": "cloudresourcemanager.organizations.list",
"path": "v1beta1/organizations",
"httpMethod": "GET",
"description": "Query Organization resources.",
"parameters": {
"pageSize": {
"type": "integer",
"description": "The maximum number of Organizations to return in the response. This field is optional.",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "A pagination token returned from a previous call to ListOrganizations that indicates from where listing should continue. This field is optional.",
"location": "query"
},
"filter": {
"type": "string",
"description": "An optional query string used to filter the Organizations to be return in the response. Filter rules are case-insensitive. Organizations may be filtered by `owner.directoryCustomerId` or by `domain`, where the domain is a Google for Work domain, for example: |Filter|Description| |------|-----------| |owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.| |domain:google.com|Organizations corresponding to the domain `google.com`.| This field is optional.",
"location": "query"
}
},
"response": {
"$ref": "ListOrganizationsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"get": {
"id": "cloudresourcemanager.organizations.get",
"path": "v1beta1/organizations/{organizationId}",
"httpMethod": "GET",
"description": "Fetches an Organization resource by id.",
"parameters": {
"organizationId": {
"type": "string",
"description": "The id of the Organization resource to fetch.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"organizationId"
],
"response": {
"$ref": "Organization"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"update": {
"id": "cloudresourcemanager.organizations.update",
"path": "v1beta1/organizations/{organizationId}",
"httpMethod": "PUT",
"description": "Updates an Organization resource.",
"parameters": {
"organizationId": {
"type": "string",
"description": "An immutable id for the Organization that is assigned on creation. This should be omitted when creating a new Organization. This field is read-only.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"organizationId"
],
"request": {
"$ref": "Organization"
},
"response": {
"$ref": "Organization"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"setIamPolicy": {
"id": "cloudresourcemanager.organizations.setIamPolicy",
"path": "v1beta1/organizations/{resource}:setIamPolicy",
"httpMethod": "POST",
"description": "Sets the access control policy on a Organization resource. Replaces any existing policy.",
"parameters": {
"resource": {
"type": "string",
"description": "REQUIRED: The resource for which policy is being specified. `resource` is usually specified as a path, such as, `projects/{project}/zones/{zone}/disks/{disk}`.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"resource"
],
"request": {
"$ref": "SetIamPolicyRequest"
},
"response": {
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"getIamPolicy": {
"id": "cloudresourcemanager.organizations.getIamPolicy",
"path": "v1beta1/organizations/{resource}:getIamPolicy",
"httpMethod": "POST",
"description": "Gets the access control policy for a Organization resource. May be empty if no such policy or resource exists.",
"parameters": {
"resource": {
"type": "string",
"description": "REQUIRED: The resource for which policy is being requested. Resource is usually specified as a path, such as, `projects/{project}`.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"resource"
],
"request": {
"$ref": "GetIamPolicyRequest"
},
"response": {
"$ref": "Policy"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"testIamPermissions": {
"id": "cloudresourcemanager.organizations.testIamPermissions",
"path": "v1beta1/organizations/{resource}:testIamPermissions",
"httpMethod": "POST",
"description": "Returns permissions that a caller has on the specified Organization.",
"parameters": {
"resource": {
"type": "string",
"description": "REQUIRED: The resource for which policy detail is being requested. `resource` is usually specified as a path, such as, `projects/{project}`.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"resource"
],
"request": {
"$ref": "TestIamPermissionsRequest"
},
"response": {
"$ref": "TestIamPermissionsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,385 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/aRfd7FZnMyWmSYyC0t8ruQh7iCI\"",
"discoveryVersion": "v1",
"id": "cloudtrace:v1",
"name": "cloudtrace",
"version": "v1",
"revision": "20150825",
"title": "Google Cloud Trace API",
"description": "The Google Cloud Trace API provides services for reading and writing runtime trace data for Cloud applications.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/tools/cloud-trace",
"protocol": "rest",
"baseUrl": "https://cloudtrace.googleapis.com/",
"basePath": "/",
"rootUrl": "https://cloudtrace.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
}
}
}
},
"schemas": {
"ListTracesResponse": {
"id": "ListTracesResponse",
"type": "object",
"description": "The response message for the ListTraces method.",
"properties": {
"traces": {
"type": "array",
"description": "The list of trace records returned.",
"items": {
"$ref": "Trace"
}
},
"nextPageToken": {
"type": "string",
"description": "If defined, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue."
}
}
},
"Trace": {
"id": "Trace",
"type": "object",
"description": "A Trace is a collection of spans describing the execution timings of a single operation.",
"properties": {
"projectId": {
"type": "string",
"description": "The Project ID of the Google Cloud project."
},
"traceId": {
"type": "string",
"description": "A 128-bit numeric value, formatted as a 32-byte hex string, that represents a trace. Each trace should have an identifier that is globally unique."
},
"spans": {
"type": "array",
"description": "The collection of span records within this trace. Spans that appear in calls to PatchTraces may be incomplete or partial.",
"items": {
"$ref": "TraceSpan"
}
}
}
},
"TraceSpan": {
"id": "TraceSpan",
"type": "object",
"description": "A span is the data recorded with a single span.",
"properties": {
"spanId": {
"type": "string",
"description": "Identifier of the span within the trace. Each span should have an identifier that is unique per trace.",
"format": "uint64"
},
"kind": {
"type": "string",
"description": "SpanKind distinguishes spans generated in a particular context. For example, two spans with the same name, one with the kind RPC_CLIENT, and the other with RPC_SERVER can indicate the queueing latency associated with the span.",
"enum": [
"SPAN_KIND_UNSPECIFIED",
"RPC_SERVER",
"RPC_CLIENT"
]
},
"name": {
"type": "string",
"description": "The name of the trace. This is sanitized and displayed on the UI. This may be a method name or some other per-callsite name. For the same binary and the same call point, it is a good practice to choose a consistent name in order to correlate cross-trace spans."
},
"startTime": {
"type": "string",
"description": "The start time of the span in nanoseconds from the UNIX epoch."
},
"endTime": {
"type": "string",
"description": "The end time of the span in nanoseconds from the UNIX epoch."
},
"parentSpanId": {
"type": "string",
"description": "Identifies the parent of the current span. May be missing. Serialized bytes representation of SpanId.",
"format": "uint64"
},
"labels": {
"type": "object",
"description": "Annotations via labels.",
"additionalProperties": {
"type": "string"
}
}
}
},
"Traces": {
"id": "Traces",
"type": "object",
"description": "A list of traces for the PatchTraces method.",
"properties": {
"traces": {
"type": "array",
"description": "A list of traces.",
"items": {
"$ref": "Trace"
}
}
}
},
"Empty": {
"id": "Empty",
"type": "object",
"description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`."
}
},
"resources": {
"projects": {
"methods": {
"patchTraces": {
"id": "cloudtrace.projects.patchTraces",
"path": "v1/projects/{projectId}/traces",
"httpMethod": "PATCH",
"description": "Updates the existing traces specified by PatchTracesRequest and inserts the new traces. Any existing trace or span fields included in an update are overwritten by the update, and any additional fields in an update are merged with the existing trace data.",
"parameters": {
"projectId": {
"type": "string",
"description": "The project id of the trace to patch.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId"
],
"request": {
"$ref": "Traces"
},
"response": {
"$ref": "Empty"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
},
"resources": {
"traces": {
"methods": {
"list": {
"id": "cloudtrace.projects.traces.list",
"path": "v1/projects/{projectId}/traces",
"httpMethod": "GET",
"description": "List traces matching the filter expression.",
"parameters": {
"projectId": {
"type": "string",
"description": "The stringified-version of the project id.",
"required": true,
"location": "path"
},
"view": {
"type": "string",
"description": "ViewType specifies the projection of the result.",
"enum": [
"VIEW_TYPE_UNSPECIFIED",
"MINIMAL",
"ROOTSPAN",
"COMPLETE"
],
"location": "query"
},
"pageSize": {
"type": "integer",
"description": "Maximum number of topics to return. If not specified or \u003c= 0, the implementation will select a reasonable value. The implemenation may always return fewer than the requested page_size.",
"format": "int32",
"location": "query"
},
"pageToken": {
"type": "string",
"description": "The token identifying the page of results to return from the ListTraces method. If present, this value is should be taken from the next_page_token field of a previous ListTracesResponse.",
"location": "query"
},
"startTime": {
"type": "string",
"description": "End of the time interval (inclusive).",
"location": "query"
},
"endTime": {
"type": "string",
"description": "Start of the time interval (exclusive).",
"location": "query"
},
"filter": {
"type": "string",
"description": "An optional filter for the request.",
"location": "query"
},
"orderBy": {
"type": "string",
"description": "The trace field used to establish the order of traces returned by the ListTraces method. Possible options are: trace_id name (name field of root span) duration (different between end_time and start_time fields of root span) start (start_time field of root span) Descending order can be specified by appending \"desc\" to the sort field: name desc Only one sort field is permitted, though this may change in the future.",
"location": "query"
}
},
"parameterOrder": [
"projectId"
],
"response": {
"$ref": "ListTracesResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"get": {
"id": "cloudtrace.projects.traces.get",
"path": "v1/projects/{projectId}/traces/{traceId}",
"httpMethod": "GET",
"description": "Gets one trace by id.",
"parameters": {
"projectId": {
"type": "string",
"description": "The project id of the trace to return.",
"required": true,
"location": "path"
},
"traceId": {
"type": "string",
"description": "The trace id of the trace to return.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"traceId"
],
"response": {
"$ref": "Trace"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
},
"v1": {
"methods": {
"getDiscovery": {
"id": "cloudtrace.getDiscovery",
"path": "v1/discovery",
"httpMethod": "GET",
"description": "Returns a discovery document in the specified `format`. The typeurl in the returned google.protobuf.Any value depends on the requested format.",
"parameters": {
"format": {
"type": "string",
"description": "The format requested for discovery.",
"location": "query"
},
"labels": {
"type": "string",
"description": "A list of labels (like visibility) influencing the scope of the requested doc.",
"repeated": true,
"location": "query"
},
"version": {
"type": "string",
"description": "The API version of the requested discovery doc.",
"location": "query"
},
"args": {
"type": "string",
"description": "Any additional arguments.",
"repeated": true,
"location": "query"
}
}
}
}
}
}
}

View file

@ -1,919 +0,0 @@
// Package cloudtrace provides access to the Google Cloud Trace API.
//
// See https://cloud.google.com/tools/cloud-trace
//
// Usage example:
//
// import "google.golang.org/api/cloudtrace/v1"
// ...
// cloudtraceService, err := cloudtrace.New(oauthHttpClient)
package cloudtrace // import "google.golang.org/api/cloudtrace/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "cloudtrace:v1"
const apiName = "cloudtrace"
const apiVersion = "v1"
const basePath = "https://cloudtrace.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Projects = NewProjectsService(s)
s.V1 = NewV1Service(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Projects *ProjectsService
V1 *V1Service
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Traces = NewProjectsTracesService(s)
return rs
}
type ProjectsService struct {
s *Service
Traces *ProjectsTracesService
}
func NewProjectsTracesService(s *Service) *ProjectsTracesService {
rs := &ProjectsTracesService{s: s}
return rs
}
type ProjectsTracesService struct {
s *Service
}
func NewV1Service(s *Service) *V1Service {
rs := &V1Service{s: s}
return rs
}
type V1Service struct {
s *Service
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); } The JSON representation for `Empty` is
// empty JSON object `{}`.
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// ListTracesResponse: The response message for the ListTraces method.
type ListTracesResponse struct {
// NextPageToken: If defined, indicates that there are more topics that
// match the request, and this value should be passed to the next
// ListTopicsRequest to continue.
NextPageToken string `json:"nextPageToken,omitempty"`
// Traces: The list of trace records returned.
Traces []*Trace `json:"traces,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ListTracesResponse) MarshalJSON() ([]byte, error) {
type noMethod ListTracesResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Trace: A Trace is a collection of spans describing the execution
// timings of a single operation.
type Trace struct {
// ProjectId: The Project ID of the Google Cloud project.
ProjectId string `json:"projectId,omitempty"`
// Spans: The collection of span records within this trace. Spans that
// appear in calls to PatchTraces may be incomplete or partial.
Spans []*TraceSpan `json:"spans,omitempty"`
// TraceId: A 128-bit numeric value, formatted as a 32-byte hex string,
// that represents a trace. Each trace should have an identifier that is
// globally unique.
TraceId string `json:"traceId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ProjectId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Trace) MarshalJSON() ([]byte, error) {
type noMethod Trace
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// TraceSpan: A span is the data recorded with a single span.
type TraceSpan struct {
// EndTime: The end time of the span in nanoseconds from the UNIX epoch.
EndTime string `json:"endTime,omitempty"`
// Kind: SpanKind distinguishes spans generated in a particular context.
// For example, two spans with the same name, one with the kind
// RPC_CLIENT, and the other with RPC_SERVER can indicate the queueing
// latency associated with the span.
//
// Possible values:
// "SPAN_KIND_UNSPECIFIED"
// "RPC_SERVER"
// "RPC_CLIENT"
Kind string `json:"kind,omitempty"`
// Labels: Annotations via labels.
Labels map[string]string `json:"labels,omitempty"`
// Name: The name of the trace. This is sanitized and displayed on the
// UI. This may be a method name or some other per-callsite name. For
// the same binary and the same call point, it is a good practice to
// choose a consistent name in order to correlate cross-trace spans.
Name string `json:"name,omitempty"`
// ParentSpanId: Identifies the parent of the current span. May be
// missing. Serialized bytes representation of SpanId.
ParentSpanId uint64 `json:"parentSpanId,omitempty,string"`
// SpanId: Identifier of the span within the trace. Each span should
// have an identifier that is unique per trace.
SpanId uint64 `json:"spanId,omitempty,string"`
// StartTime: The start time of the span in nanoseconds from the UNIX
// epoch.
StartTime string `json:"startTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "EndTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *TraceSpan) MarshalJSON() ([]byte, error) {
type noMethod TraceSpan
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Traces: A list of traces for the PatchTraces method.
type Traces struct {
// Traces: A list of traces.
Traces []*Trace `json:"traces,omitempty"`
// ForceSendFields is a list of field names (e.g. "Traces") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Traces) MarshalJSON() ([]byte, error) {
type noMethod Traces
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// method id "cloudtrace.projects.patchTraces":
type ProjectsPatchTracesCall struct {
s *Service
projectId string
traces *Traces
opt_ map[string]interface{}
ctx_ context.Context
}
// PatchTraces: Updates the existing traces specified by
// PatchTracesRequest and inserts the new traces. Any existing trace or
// span fields included in an update are overwritten by the update, and
// any additional fields in an update are merged with the existing trace
// data.
func (r *ProjectsService) PatchTraces(projectId string, traces *Traces) *ProjectsPatchTracesCall {
c := &ProjectsPatchTracesCall{s: r.s, opt_: make(map[string]interface{})}
c.projectId = projectId
c.traces = traces
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsPatchTracesCall) Fields(s ...googleapi.Field) *ProjectsPatchTracesCall {
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.
func (c *ProjectsPatchTracesCall) Context(ctx context.Context) *ProjectsPatchTracesCall {
c.ctx_ = ctx
return c
}
func (c *ProjectsPatchTracesCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.traces)
if err != nil {
return nil, err
}
ctype := "application/json"
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, "v1/projects/{projectId}/traces")
urls += "?" + params.Encode()
req, _ := http.NewRequest("PATCH", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", c.s.userAgent())
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudtrace.projects.patchTraces" call.
// Exactly one of *Empty or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Empty.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 *ProjectsPatchTracesCall) Do() (*Empty, 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 := &Empty{
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": "Updates the existing traces specified by PatchTracesRequest and inserts the new traces. Any existing trace or span fields included in an update are overwritten by the update, and any additional fields in an update are merged with the existing trace data.",
// "httpMethod": "PATCH",
// "id": "cloudtrace.projects.patchTraces",
// "parameterOrder": [
// "projectId"
// ],
// "parameters": {
// "projectId": {
// "description": "The project id of the trace to patch.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1/projects/{projectId}/traces",
// "request": {
// "$ref": "Traces"
// },
// "response": {
// "$ref": "Empty"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudtrace.projects.traces.get":
type ProjectsTracesGetCall struct {
s *Service
projectId string
traceId string
opt_ map[string]interface{}
ctx_ context.Context
}
// Get: Gets one trace by id.
func (r *ProjectsTracesService) Get(projectId string, traceId string) *ProjectsTracesGetCall {
c := &ProjectsTracesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.projectId = projectId
c.traceId = traceId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsTracesGetCall) Fields(s ...googleapi.Field) *ProjectsTracesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsTracesGetCall) IfNoneMatch(entityTag string) *ProjectsTracesGetCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *ProjectsTracesGetCall) Context(ctx context.Context) *ProjectsTracesGetCall {
c.ctx_ = ctx
return c
}
func (c *ProjectsTracesGetCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
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, "v1/projects/{projectId}/traces/{traceId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
"traceId": c.traceId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// 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"
// ]
// }
}
// method id "cloudtrace.projects.traces.list":
type ProjectsTracesListCall struct {
s *Service
projectId string
opt_ map[string]interface{}
ctx_ context.Context
}
// List: List traces matching the filter expression.
func (r *ProjectsTracesService) List(projectId string) *ProjectsTracesListCall {
c := &ProjectsTracesListCall{s: r.s, opt_: make(map[string]interface{})}
c.projectId = projectId
return c
}
// EndTime sets the optional parameter "endTime": Start of the time
// interval (exclusive).
func (c *ProjectsTracesListCall) EndTime(endTime string) *ProjectsTracesListCall {
c.opt_["endTime"] = endTime
return c
}
// Filter sets the optional parameter "filter": An optional filter for
// the request.
func (c *ProjectsTracesListCall) Filter(filter string) *ProjectsTracesListCall {
c.opt_["filter"] = filter
return c
}
// OrderBy sets the optional parameter "orderBy": The trace field used
// to establish the order of traces returned by the ListTraces method.
// Possible options are: trace_id name (name field of root span)
// duration (different between end_time and start_time fields of root
// span) start (start_time field of root span) Descending order can be
// specified by appending "desc" to the sort field: name desc Only one
// sort field is permitted, though this may change in the future.
func (c *ProjectsTracesListCall) OrderBy(orderBy string) *ProjectsTracesListCall {
c.opt_["orderBy"] = orderBy
return c
}
// PageSize sets the optional parameter "pageSize": Maximum number of
// topics to return. If not specified or <= 0, the implementation will
// select a reasonable value. The implemenation may always return fewer
// than the requested page_size.
func (c *ProjectsTracesListCall) PageSize(pageSize int64) *ProjectsTracesListCall {
c.opt_["pageSize"] = pageSize
return c
}
// PageToken sets the optional parameter "pageToken": The token
// identifying the page of results to return from the ListTraces method.
// If present, this value is should be taken from the next_page_token
// field of a previous ListTracesResponse.
func (c *ProjectsTracesListCall) PageToken(pageToken string) *ProjectsTracesListCall {
c.opt_["pageToken"] = pageToken
return c
}
// StartTime sets the optional parameter "startTime": End of the time
// interval (inclusive).
func (c *ProjectsTracesListCall) StartTime(startTime string) *ProjectsTracesListCall {
c.opt_["startTime"] = startTime
return c
}
// View sets the optional parameter "view": ViewType specifies the
// projection of the result.
//
// Possible values:
// "VIEW_TYPE_UNSPECIFIED"
// "MINIMAL"
// "ROOTSPAN"
// "COMPLETE"
func (c *ProjectsTracesListCall) View(view string) *ProjectsTracesListCall {
c.opt_["view"] = view
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsTracesListCall) Fields(s ...googleapi.Field) *ProjectsTracesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsTracesListCall) IfNoneMatch(entityTag string) *ProjectsTracesListCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *ProjectsTracesListCall) Context(ctx context.Context) *ProjectsTracesListCall {
c.ctx_ = ctx
return c
}
func (c *ProjectsTracesListCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["endTime"]; ok {
params.Set("endTime", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["filter"]; ok {
params.Set("filter", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["orderBy"]; ok {
params.Set("orderBy", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageSize"]; ok {
params.Set("pageSize", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["startTime"]; ok {
params.Set("startTime", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["view"]; ok {
params.Set("view", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/traces")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"projectId": c.projectId,
})
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudtrace.projects.traces.list" call.
// Exactly one of *ListTracesResponse or error will be non-nil. Any
// non-2xx status code is an error. Response headers are in either
// *ListTracesResponse.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 *ProjectsTracesListCall) Do() (*ListTracesResponse, 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 := &ListTracesResponse{
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": "List traces matching the filter expression.",
// "httpMethod": "GET",
// "id": "cloudtrace.projects.traces.list",
// "parameterOrder": [
// "projectId"
// ],
// "parameters": {
// "endTime": {
// "description": "Start of the time interval (exclusive).",
// "location": "query",
// "type": "string"
// },
// "filter": {
// "description": "An optional filter for the request.",
// "location": "query",
// "type": "string"
// },
// "orderBy": {
// "description": "The trace field used to establish the order of traces returned by the ListTraces method. Possible options are: trace_id name (name field of root span) duration (different between end_time and start_time fields of root span) start (start_time field of root span) Descending order can be specified by appending \"desc\" to the sort field: name desc Only one sort field is permitted, though this may change in the future.",
// "location": "query",
// "type": "string"
// },
// "pageSize": {
// "description": "Maximum number of topics to return. If not specified or \u003c= 0, the implementation will select a reasonable value. The implemenation may always return fewer than the requested page_size.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "The token identifying the page of results to return from the ListTraces method. If present, this value is should be taken from the next_page_token field of a previous ListTracesResponse.",
// "location": "query",
// "type": "string"
// },
// "projectId": {
// "description": "The stringified-version of the project id.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "startTime": {
// "description": "End of the time interval (inclusive).",
// "location": "query",
// "type": "string"
// },
// "view": {
// "description": "ViewType specifies the projection of the result.",
// "enum": [
// "VIEW_TYPE_UNSPECIFIED",
// "MINIMAL",
// "ROOTSPAN",
// "COMPLETE"
// ],
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/projects/{projectId}/traces",
// "response": {
// "$ref": "ListTracesResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "cloudtrace.getDiscovery":
type V1GetDiscoveryCall struct {
s *Service
opt_ map[string]interface{}
ctx_ context.Context
}
// GetDiscovery: Returns a discovery document in the specified `format`.
// The typeurl in the returned google.protobuf.Any value depends on the
// requested format.
func (r *V1Service) GetDiscovery() *V1GetDiscoveryCall {
c := &V1GetDiscoveryCall{s: r.s, opt_: make(map[string]interface{})}
return c
}
// Args sets the optional parameter "args": Any additional arguments.
func (c *V1GetDiscoveryCall) Args(args string) *V1GetDiscoveryCall {
c.opt_["args"] = args
return c
}
// Format sets the optional parameter "format": The format requested for
// discovery.
func (c *V1GetDiscoveryCall) Format(format string) *V1GetDiscoveryCall {
c.opt_["format"] = format
return c
}
// Labels sets the optional parameter "labels": A list of labels (like
// visibility) influencing the scope of the requested doc.
func (c *V1GetDiscoveryCall) Labels(labels string) *V1GetDiscoveryCall {
c.opt_["labels"] = labels
return c
}
// Version sets the optional parameter "version": The API version of the
// requested discovery doc.
func (c *V1GetDiscoveryCall) Version(version string) *V1GetDiscoveryCall {
c.opt_["version"] = version
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *V1GetDiscoveryCall) Fields(s ...googleapi.Field) *V1GetDiscoveryCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *V1GetDiscoveryCall) IfNoneMatch(entityTag string) *V1GetDiscoveryCall {
c.opt_["ifNoneMatch"] = entityTag
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.
func (c *V1GetDiscoveryCall) Context(ctx context.Context) *V1GetDiscoveryCall {
c.ctx_ = ctx
return c
}
func (c *V1GetDiscoveryCall) doRequest(alt string) (*http.Response, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", alt)
if v, ok := c.opt_["args"]; ok {
params.Set("args", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["format"]; ok {
params.Set("format", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["labels"]; ok {
params.Set("labels", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["version"]; ok {
params.Set("version", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/discovery")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.SetOpaque(req.URL)
req.Header.Set("User-Agent", c.s.userAgent())
if v, ok := c.opt_["ifNoneMatch"]; ok {
req.Header.Set("If-None-Match", fmt.Sprintf("%v", v))
}
if c.ctx_ != nil {
return ctxhttp.Do(c.ctx_, c.s.client, req)
}
return c.s.client.Do(req)
}
// Do executes the "cloudtrace.getDiscovery" call.
func (c *V1GetDiscoveryCall) 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": "Returns a discovery document in the specified `format`. The typeurl in the returned google.protobuf.Any value depends on the requested format.",
// "httpMethod": "GET",
// "id": "cloudtrace.getDiscovery",
// "parameters": {
// "args": {
// "description": "Any additional arguments.",
// "location": "query",
// "repeated": true,
// "type": "string"
// },
// "format": {
// "description": "The format requested for discovery.",
// "location": "query",
// "type": "string"
// },
// "labels": {
// "description": "A list of labels (like visibility) influencing the scope of the requested doc.",
// "location": "query",
// "repeated": true,
// "type": "string"
// },
// "version": {
// "description": "The API version of the requested discovery doc.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "v1/discovery"
// }
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,690 +0,0 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/FD4oCwspiZqN6eCjsBmxDzsj5B8\"",
"discoveryVersion": "v1",
"id": "container:v1",
"name": "container",
"version": "v1",
"revision": "20150603",
"title": "Google Container Engine API",
"description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/container-engine/",
"protocol": "rest",
"baseUrl": "https://container.googleapis.com/",
"basePath": "/",
"rootUrl": "https://container.googleapis.com/",
"servicePath": "",
"batchPath": "batch",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
}
}
}
},
"schemas": {
"ListClustersResponse": {
"id": "ListClustersResponse",
"type": "object",
"description": "ListClustersResponse is the result of ListClustersRequest.",
"properties": {
"clusters": {
"type": "array",
"description": "A list of clusters in the project in the specified zone, or across all ones.",
"items": {
"$ref": "Cluster"
}
}
}
},
"Cluster": {
"id": "Cluster",
"type": "object",
"description": "A Google Container Engine cluster.",
"properties": {
"name": {
"type": "string",
"description": "The name of this cluster. The name must be unique within this project and zone, and can be up to 40 characters with the following restrictions: * Lowercase letters, numbers, and hyphens only. * Must start with a letter. * Must end with a number or a letter."
},
"description": {
"type": "string",
"description": "An optional description of this cluster."
},
"initialNodeCount": {
"type": "integer",
"description": "The number of nodes to create in this cluster. You must ensure that your Compute Engine [resource quota](/compute/docs/resource-quotas) is sufficient for this number of instances. You must also have available firewall and routes quota.",
"format": "int32"
},
"nodeConfig": {
"$ref": "NodeConfig",
"description": "Parameters used in creating the cluster's nodes. See the descriptions of the child properties of `nodeConfig`. If unspecified, the defaults for all child properties are used."
},
"masterAuth": {
"$ref": "MasterAuth",
"description": "The authentication information for accessing the master."
},
"loggingService": {
"type": "string",
"description": "The logging service that the cluster should write logs to. Currently available options: * \"logging.googleapis.com\" - the Google Cloud Logging service * \"none\" - no logs will be exported from the cluster * \"\" - default value; the default is \"logging.googleapis.com\""
},
"monitoringService": {
"type": "string",
"description": "The monitoring service that the cluster should write metrics to. Currently available options: * \"monitoring.googleapis.com\" - the Google Cloud Monitoring service * \"none\" - no metrics will be exported from the cluster * \"\" - default value; the default is \"monitoring.googleapis.com\""
},
"network": {
"type": "string",
"description": "The name of the Google Compute Engine [network](/compute/docs/networking#networks_1) to which the cluster is connected. If left unspecified, the \"default\" network will be used."
},
"clusterIpv4Cidr": {
"type": "string",
"description": "The IP address range of the container pods in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically chosen or specify a `/14` block in `10.0.0.0/8`."
},
"selfLink": {
"type": "string",
"description": "[Output only] Server-defined URL for the resource."
},
"zone": {
"type": "string",
"description": "[Output only] The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."
},
"endpoint": {
"type": "string",
"description": "[Output only] The IP address of this cluster's Kubernetes master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. See the `masterAuth` property of this resource for username and password information."
},
"initialClusterVersion": {
"type": "string",
"description": "[Output only] The software version of Kubernetes master and kubelets used in the cluster when it was first created. The version can be upgraded over time."
},
"currentMasterVersion": {
"type": "string",
"description": "[Output only] The current software version of the master endpoint."
},
"currentNodeVersion": {
"type": "string",
"description": "[Output only] The current version of the node software components. If they are currently at different versions because they're in the process of being upgraded, this reflects the minimum version of any of them."
},
"createTime": {
"type": "string",
"description": "[Output only] The time the cluster was created, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format."
},
"status": {
"type": "string",
"description": "[Output only] The current status of this cluster.",
"enum": [
"STATUS_UNSPECIFIED",
"PROVISIONING",
"RUNNING",
"RECONCILING",
"STOPPING",
"ERROR"
]
},
"statusMessage": {
"type": "string",
"description": "[Output only] Additional information about the current status of this cluster, if available."
},
"nodeIpv4CidrSize": {
"type": "integer",
"description": "[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the container_ipv4_cidr range.",
"format": "int32"
},
"servicesIpv4Cidr": {
"type": "string",
"description": "[Output only] The IP address range of the Kubernetes services in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last /16 from the container CIDR."
},
"instanceGroupUrls": {
"type": "array",
"description": "[Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster.",
"items": {
"type": "string"
}
}
}
},
"NodeConfig": {
"id": "NodeConfig",
"type": "object",
"description": "Per-node parameters.",
"properties": {
"machineType": {
"type": "string",
"description": "The name of a Google Compute Engine [machine type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If unspecified, the default machine type is `n1-standard-1`."
},
"diskSizeGb": {
"type": "integer",
"description": "Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB.",
"format": "int32"
},
"oauthScopes": {
"type": "array",
"description": "The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. The following scopes are recommended, but not required, and by default are not included: * `https://www.googleapis.com/auth/compute` is required for mounting persistent storage on your nodes. * `https://www.googleapis.com/auth/devstorage.read_only` is required for communicating with *gcr.io*. If unspecified, no scopes are added.",
"items": {
"type": "string"
}
}
}
},
"MasterAuth": {
"id": "MasterAuth",
"type": "object",
"description": "The authentication information for accessing the master endpoint. Authentication can be done using HTTP basic auth or using client certificates.",
"properties": {
"username": {
"type": "string",
"description": "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint."
},
"password": {
"type": "string",
"description": "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint. Because the master endpoint is open to the internet, you should create a strong password."
},
"clusterCaCertificate": {
"type": "string",
"description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster."
},
"clientCertificate": {
"type": "string",
"description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint."
},
"clientKey": {
"type": "string",
"description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint."
}
}
},
"CreateClusterRequest": {
"id": "CreateClusterRequest",
"type": "object",
"description": "CreateClusterRequest creates a cluster.",
"properties": {
"cluster": {
"$ref": "Cluster",
"description": "A [cluster resource](/container-engine/reference/rest/v1/projects.zones.clusters)"
}
}
},
"Operation": {
"id": "Operation",
"type": "object",
"description": "Defines the operation resource. All fields are output only.",
"properties": {
"name": {
"type": "string",
"description": "The server-assigned ID for the operation."
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation is taking place."
},
"operationType": {
"type": "string",
"description": "The operation type.",
"enum": [
"TYPE_UNSPECIFIED",
"CREATE_CLUSTER",
"DELETE_CLUSTER",
"UPGRADE_MASTER",
"UPGRADE_NODES",
"REPAIR_CLUSTER"
]
},
"status": {
"type": "string",
"description": "The current status of the operation.",
"enum": [
"STATUS_UNSPECIFIED",
"PENDING",
"RUNNING",
"DONE"
]
},
"statusMessage": {
"type": "string",
"description": "If an error has occurred, a textual description of the error."
},
"selfLink": {
"type": "string",
"description": "Server-defined URL for the resource."
},
"targetLink": {
"type": "string",
"description": "Server-defined URL for the target of the operation."
}
}
},
"UpdateClusterRequest": {
"id": "UpdateClusterRequest",
"type": "object",
"description": "UpdateClusterRequest updates a cluster.",
"properties": {
"update": {
"$ref": "ClusterUpdate",
"description": "A description of the update."
}
}
},
"ClusterUpdate": {
"id": "ClusterUpdate",
"type": "object",
"description": "ClusterUpdate describes an update to the cluster.",
"properties": {
"desiredNodeVersion": {
"type": "string",
"description": "The Kubernetes version to change the nodes to (typically an upgrade). Use \"-\" to upgrade to the latest version supported by the server."
}
}
},
"ListOperationsResponse": {
"id": "ListOperationsResponse",
"type": "object",
"description": "ListOperationsResponse is the result of ListOperationsRequest.",
"properties": {
"operations": {
"type": "array",
"description": "A list of operations in the project in the specified zone.",
"items": {
"$ref": "Operation"
}
}
}
},
"ServerConfig": {
"id": "ServerConfig",
"type": "object",
"description": "Container Engine Server configuration.",
"properties": {
"defaultClusterVersion": {
"type": "string",
"description": "What version this server deploys by default."
},
"validNodeVersions": {
"type": "array",
"description": "List of valid node upgrade target versions.",
"items": {
"type": "string"
}
}
}
}
},
"resources": {
"projects": {
"resources": {
"zones": {
"methods": {
"getServerconfig": {
"id": "container.projects.zones.getServerconfig",
"path": "v1/projects/{projectId}/zones/{zone}/serverconfig",
"httpMethod": "GET",
"description": "Returns configuration info about the Container Engine service.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone"
],
"response": {
"$ref": "ServerConfig"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
},
"resources": {
"clusters": {
"methods": {
"list": {
"id": "container.projects.zones.clusters.list",
"path": "v1/projects/{projectId}/zones/{zone}/clusters",
"httpMethod": "GET",
"description": "Lists all clusters owned by a project in either the specified zone or all zones.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or \"-\" for all zones.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone"
],
"response": {
"$ref": "ListClustersResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"get": {
"id": "container.projects.zones.clusters.get",
"path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "GET",
"description": "Gets a specific cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
"required": true,
"location": "path"
},
"clusterId": {
"type": "string",
"description": "The name of the cluster to retrieve.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone",
"clusterId"
],
"response": {
"$ref": "Cluster"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"create": {
"id": "container.projects.zones.clusters.create",
"path": "v1/projects/{projectId}/zones/{zone}/clusters",
"httpMethod": "POST",
"description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network](/compute/docs/networking#networks_1). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone"
],
"request": {
"$ref": "CreateClusterRequest"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"update": {
"id": "container.projects.zones.clusters.update",
"path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "PUT",
"description": "Update settings of a specific cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
"required": true,
"location": "path"
},
"clusterId": {
"type": "string",
"description": "The name of the cluster to upgrade.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone",
"clusterId"
],
"request": {
"$ref": "UpdateClusterRequest"
},
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"delete": {
"id": "container.projects.zones.clusters.delete",
"path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "DELETE",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
"required": true,
"location": "path"
},
"clusterId": {
"type": "string",
"description": "The name of the cluster to delete.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone",
"clusterId"
],
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
},
"operations": {
"methods": {
"list": {
"id": "container.projects.zones.operations.list",
"path": "v1/projects/{projectId}/zones/{zone}/operations",
"httpMethod": "GET",
"description": "Lists all operations in a project in a specific zone or all zones.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone"
],
"response": {
"$ref": "ListOperationsResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"get": {
"id": "container.projects.zones.operations.get",
"path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
"httpMethod": "GET",
"description": "Gets the specified operation.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
"required": true,
"location": "path"
},
"operationId": {
"type": "string",
"description": "The server-assigned `name` of the operation.",
"required": true,
"location": "path"
}
},
"parameterOrder": [
"projectId",
"zone",
"operationId"
],
"response": {
"$ref": "Operation"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more